Re: Finding out the appropriate texture size for a font

2024-07-29 Thread Alexei Podtelezhnikov
> > have to convert to pixels > > Can you explain how to do that? Since the bounding box is fixed, I > presume it will somehow involve the pixel size I'm passing to to > FT_Set_Pixel_Sizes. I've gone through the documentation and am > still a little confused. I suggest using x_scale and y_scale f

Re: FT Cache Subsystem: Custom caches

2023-11-07 Thread Alexei Podtelezhnikov
Hi Kelvin If you only interested in subpixels shifts and intend to cache 3 positions, you can achieve using LCD rendering and https://freetype.org/freetype2/docs/reference/ft2-lcd_rendering.html#ft_library_setlcdgeometry. It is apparent that LCD rendering is essentially 3 traditional antialiased b

Re: Font Rendering: Multiple FT_Faces and baselines

2023-07-29 Thread Alexei Podtelezhnikov
> > ... calculate an "average" baseline and align to that ... > Or align to the midpoints of the overall font glyph boxes (including > font ascent and font descent). That may be a suitable compromise. Or... whatever works. FreeType provides a client with all kinds of metrics and bounding boxes,

Re: Inconsistent endianness in differing bitmap depths

2023-07-29 Thread Alexei Podtelezhnikov
> When using mono mode, the bitmap is rendered in big endian format where the > most significant bit is the leftmost pixel, while in default mode the > bitmap is rendered in little endian, consistent with my cpu. This is documented https://freetype.org/freetype2/docs/reference/ft2-basic_types.html

Re: Fw: How to have sharp fonts?

2023-03-02 Thread Alexei Podtelezhnikov
>> * Usually pure greyscale (pixel) antialasing is way better for >> me, but it also depends on whether the background is dark or >> light and whether the rendering library applies the right >> gamma correction for that > > Since many/most text setting libraries don't take this into > account

Re: Fw: How to have sharp fonts?

2023-03-01 Thread Alexei Podtelezhnikov
>> I have problem with all linux distros about fonts generally, >> fonts are very smooth or fuzzy and it hurts my eyes when i >> read more of the texts , [...] any patches to improve the >> fonts to be like windows, very sharp Since Windows is your gold standard, this is their tunable settings: ht

Re: 2.10.3 BW renderer changes

2023-01-11 Thread Alexei Podtelezhnikov
With freetype up to 2.10.2 I obtain the desired nice bitmap, with > freetype since 2.10.3 (including the last 2.12.1) I obtain a different > bitmap. > > My question is if it's possible with some parameter to obtain the "old" > bitmap with freetype 2.12.1. > > Thank you >

2.10.3 BW renderer changes

2023-01-09 Thread Alexei Podtelezhnikov
Davide, > The new output is much worse, most of chars have single dots protruding in the external outline. We won't be able to help you unless you help us to reproduce or see the issue. At the very least you should name the font and the size, and give a screenshot. Also, in our mind, only bugs i

Re: GSoC project `ftinspect` now in master

2022-10-03 Thread Alexei Podtelezhnikov
Congratulations! Alexei > On Oct 3, 2022, at 12:41, Charlie Jiang wrote: > > Hi Werner and other folks, > > It's extremely delightful to hear that my project has been merged into > `master`! > > I would express my deep gratitude to all who lent me a hand during the > project, especially We

Infinality removal

2022-06-21 Thread Alexei Podtelezhnikov
Dear FreeType community, We have just committed a forewarning about Infinality removal. - TrueType interpreter version 38 (aka Infinality) that was first introduced about 10 years ago in FreeType 2.4.11 is now deprecated and slated to be removed in the next version. TrueType interprete

Re: Trouble installing with make on Ubuntu 20.04 (WSL 2), /bin/sh: 2: ./configure: not found

2021-12-02 Thread Alexei Podtelezhnikov
> cd builds/unix; \ > ./configure > /bin/sh: 2: ./configure: not found ./autogen.sh, see https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/docs/INSTALL.UNIX or https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/README.git FreeType has good docs worth your time rea

Re: Using the image cache.

2021-12-02 Thread Alexei Podtelezhnikov
> using FT_Glyph.advance.x to move the cursor to the next start. Do you also use FT_BitmapGlyph->left? https://freetype.org/freetype2/docs/reference/ft2-glyph_management.html#ft_bitmapglyphrec Alexei

Re: FT_Render_Glyph() and the usage of the stack for embeded software.

2021-09-21 Thread Alexei Podtelezhnikov
> Is there any way that would allow Ft_Render_Glyph() to use more heap instead? We use stack for performance reasons, but I never checked that. The majority of rendering stack are reserved here: https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/src/smooth/ftgrays.c#L1941 for smooth a

Re: render 3 glyphes into the one buffer

2021-08-03 Thread Alexei Podtelezhnikov
On Tue, Aug 3, 2021 at 9:32 AM Vitaliy Fadeev wrote: > > On Вт, 2021-08-03 at 08:47 -0400, Alexei Podtelezhnikov wrote: > > > Question 1: Possible to render glyphs directly into te one big > > > bitmap ? > > > > If you are ready to manage the buffer yourse

Re: render 3 glyphes into the one buffer

2021-08-03 Thread Alexei Podtelezhnikov
> Question 1: Possible to render glyphs directly into te one big bitmap ? If you are ready to manage the buffer yourselves and carefully track the pen coordinates for proper layout, you might be able to use FT_Outline_Render with FT_RASTER_FLAG_DIRECT and some callback function. https://www.free

Re: Compiling freetype without make and cmake

2021-07-02 Thread Alexei Podtelezhnikov
Hi there If you can create and contribute platformio.ini for FreeType, we do not mind distributing it and can certainly check if it makes sense. The syntax and structure of platformio.ini seems rather straightforward. FreeType has very optional external dependencies. Alexei

Re: Question about zero render issue

2021-04-21 Thread Alexei Podtelezhnikov
You can add this to mimic Adobe for this glyph > error = FT_Load_Glyph(pFTFace, 3, FT_LOAD_DEFAULT); pFTFace->glyph->outline.flags |= FT_OUTLINE_EVEN_ODD_FILL; > error = FT_Get_Glyph(pFTFace->glyph, &glyph); > FT_Glyph_To_Bitmap(&glyph, FT_RENDER_MODE_NORMAL, 0, 1); As Werner said, this is a

Re: building ghostscript with FreeType 2.10.3 and newer

2020-10-20 Thread Alexei Podtelezhnikov
> withdrawn macro that wasn't intended for external usage We should drop it from the demos too, shouldn't we?

Re: undefined reference error when running c++ file depends on freetype2.5

2020-05-19 Thread Alexei Podtelezhnikov
On Tue, May 19, 2020 at 9:52 AM Othman El-Kurdi wrote: > I'm trying to compile freetype2.5 on ubuntu 20.04 LTS (virtual machine), so > that I can use it to compile a c++ script. where I'm facing lot's of errors. Huh? Ubuntu 20.04 comes with FreeType 2.10.1. Try to use or install that. Then you j

Re: FT Performance Regression?

2019-11-05 Thread Alexei Podtelezhnikov
> > This is definitely not a bottle neck > > Maybe, but 1/3rd of a function call being spent not doing actual work is > definitely concerning in a world where you only have 33.3ms or 16.6ms to do > all your work that frame. > > It looks like setjmp in FreeType is basically used to do exception-like

Re: FT Performance Regression?

2019-11-01 Thread Alexei Podtelezhnikov
> Thanks, do you know how much difference the span batching made to performance? In depends on your program. Simple scanlines might be delivered at once. Freetype won't wait for you to process each spam. > It's also been pointed out to me that setjmp/longjmp can be very slow (eg, 12ms of a 36ms c

Re: FT Performance Regression?

2019-10-27 Thread Alexei Podtelezhnikov
> > Does using clip_box solve it? > Yes, using the clip_box logic from my earlier email. Once again, not > documented nor called out in a release note. I've not looked at the code for > 2.10.1, but if all you've done is fixed the crash when omitting > FT_RASTER_FLAG_CLIP so that it uses an unbou

Re: FT Performance Regression?

2019-10-27 Thread Alexei Podtelezhnikov
> On Oct 27, 2019, at 18:07, Jamie Dale wrote: > > > This is fixed in 2.10.1. > Good to know. Once again, not called out in the upgrade notes. Huh? See line 70. http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/CHANGES > > What is the performance issue? > > Seriously, FT_Ou

Re: FT Performance Regression?

2019-10-27 Thread Alexei Podtelezhnikov
> FreeType 2.10 we found that if you use FT_RASTER_FLAG_DIRECT you now *must* > also use FT_RASTER_FLAG_CLIP and specify a clip_box otherwise FreeType will > crash. This is fixed in 2.10.1. What is the performance issue?

Re: FT Performance Regression?

2019-10-26 Thread Alexei Podtelezhnikov
> >> FreeType 2.6 used to use an unbounded clip_box in the >> FT_Raster_Params struct, and internally the gray_compute_cbox >> function would clamp it to a reasonable range. >> >> That clamping no longer happens, so you have to do it yourself >> before calling the function. The docs don't real

Re: [ft] _sprintf already defined

2019-06-13 Thread Alexei Podtelezhnikov
> LNK2005: _sprintf already defined in freetype.lib(bdf.ob) > LNK2019: unresolved external symbol __stdio_common_vsprintf referenced in > function _vsnprintf_l Why don't you use freetype2/builds/windows/vc2010/freetype.vcxproj? It may ask for an upgrade to VC2019 but should work. If you insist on

Re: [ft] [ft-devel] Three GSoC projects for FreeType

2019-05-07 Thread Alexei Podtelezhnikov
> Which svg renderer will be used? Which XML parser will be used? Because, > that > could add heavy SDK deps to freetype. There are constraints that make this project possible. These some quotes from https://docs.microsoft.com/en-us/typography/opentype/spec/svg - Adoption of SVG for use in OpenT

Re: [ft] Prevent synthesis of Unicode charmap?

2018-12-12 Thread Alexei Podtelezhnikov
> Is there a way to prevent FreeType from synthesizing a Unicode charmap, or at least clearly identifying the synthesized charmap as such? FT_Get_CMap_Format will return -1 for synthetic cmaps in TrueType fonts, but also return -1 for all non-TrueType cmaps The synthetic cmap is added last, which

Re: [ft] are there font types for which FT_LOAD_NO_RECURSE is supposed to fail?

2018-09-19 Thread Alexei Podtelezhnikov
On Wed, Sep 19, 2018 at 2:37 AM Kevin Rogovin wrote: > I am thinking that whether or not glyph metrics are loaded with > FT_LOAD_NO_RECURSE is dependent on font driver, i.e font format. No. It depends on the glyph format (FT_GlyphSlot->format) https://www.freetype.org/freetype2/docs/reference/ft

Re: [ft] are there font types for which FT_LOAD_NO_RECURSE is supposed to fail?

2018-09-18 Thread Alexei Podtelezhnikov
Kevin, To understand relationships between the flags, please study just a few lines of code here: http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/base/ftobjs.c#n818 FT_LOAD_NO_RECURSE basically cancels everything including metrics calculations. It only gives you a list of glyph c

[ft] Straight FT_PIXEL_MODE_RGBA

2018-08-20 Thread Alexei Podtelezhnikov
Hi all, I propose to default to straight RGBA color space in FreeType. This is especially important before the next FreeType release 2.10 with CPAL/COLR support. I will quote from PNG documentation for the overarching reason: "PNG also uses only unassociated alpha, wherein the actual gray or colo

[ft] Unusual LCD pixel layout

2018-05-02 Thread Alexei Podtelezhnikov
Hi all, If you own an LCD panel with unusual pixel layout, not the regular RGB or BGR stripes, this is a call for testing for you. Traditional ClearType-style subpixel rendering would not work for you, but Harmony LCD rendering just might. Harmony was discovered when I realized that ClearType ren

Re: [ft] Rendering regression in 2.8.1 on RGB screens

2017-10-10 Thread Alexei Podtelezhnikov
> Do you know which change / version in Firefox fixed this, or did you simply > mean that you can't reproduce it on your machine with Firefox 56? 20 days ago. https://bugzilla.mozilla.org/show_bug.cgi?id=1400721 I tested Firefox 56 final. > > On 2017-10-10 14:07, Alexei Pod

Re: [ft] Rendering regression in 2.8.1 on RGB screens

2017-10-10 Thread Alexei Podtelezhnikov
> rendering artifacts can be observed in Mozilla Firefox: I am happy to report that this is fixed now in Firefox 56. ___ Freetype mailing list Freetype@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype

Re: [ft] [ft-devel] [ft-announce] Announcing FreeType version 2.6.1

2015-10-08 Thread Alexei Podtelezhnikov
On Thu, Oct 8, 2015 at 2:39 AM, Jan Engelhardt wrote: >>Why distributions are more conservative about FreeType than kernel is beyond >>me. > > If you have too old a kernel, some of your hardware may not > activate/behave properly. If you have too old a freetype, the worst that > can happen is "ju

Re: [ft] [ft-devel] [ft-announce] Announcing FreeType version 2.6.1

2015-10-07 Thread Alexei Podtelezhnikov
On Wed, Oct 7, 2015 at 4:33 PM, Behdad Esfahbod wrote: > Can you please make more quick-and-small releases for important fixes? It does not matter considering that Fedora 22 runs 2.5.5, which is progressive in comparison to Android 5.1.1 runs 2.5.3 Ubuntu Vivid runs 2.5.2 iOS runs 2.4.7 last time

Re: [ft] Rendering differences between 2.3.12 and 2.5.3

2014-11-23 Thread Alexei Podtelezhnikov
On Sun, Nov 23, 2014 at 2:26 AM, Werner LEMBERG wrote: > Can you provide a recipe how to emulate the old behaviour? It might > be worth to add it to the documentation. As far as I remember. Freetype used to increase the advance by 2x the emboldening strength, which was too much. Now it is 1x, w

Re: [ft] Rendering differences between 2.3.12 and 2.5.3

2014-11-23 Thread Alexei Podtelezhnikov
>> This is the change that you want to undo for yourself >> http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=cea9d7a6820bf7cca8d79d813908ce085a3d3d5d > > Does this also undo the changes to the italicized text? From > a quick glance at the diff it looks as if this affects > FT_Glyp

[ft] Rendering differences between 2.3.12 and 2.5.3

2014-11-22 Thread Alexei Podtelezhnikov
> If the text rendered by freetype is only a little bit wider than it > used to be, whole words might suddenly end up on a new line > which can mess up the whole layout. You've got to admit that 2.5.3 looks better. :) Yes advances for emboldened text changed, but ultimately Freetype is not a text

Re: [ft] Manually constructing an FT_Outline

2014-11-19 Thread Alexei Podtelezhnikov
> So FreeType could really fill in a market gap, i.e. a vector drawing engine > with a strong copyleft license. Right. Freetype is going to need arc and ellipse primitives before then. :) ___ Freetype mailing list Freetype@nongnu.org https://lists.nongn

Re: [ft] Manually constructing an FT_Outline

2014-11-17 Thread Alexei Podtelezhnikov
>> are there any convenience functions or macros to manually construct >> an FT_Outline in a way that is similar to the FT_Stroker APIs? >> e.g. functions like FT_Outline_LineTo(), >> FT_Outline_CubicTo()would come in really handy or do I really >> have to do all this manually? > No there aren

Re: [ft] Determining pixel dimensions for bitmap

2014-11-03 Thread Alexei Podtelezhnikov
Earlier you said: > > width = bbox.xMax - bbox.xMin; > > height = bbox.yMax - bbox.yMin; > > > > pixelwidth = width >> 6; > > pixelheight = height >> 6; > > > > if((width & 0x3f) > 31) pixelwidth++; > > if((height & 0x3f) > 31) pixelheight++; Actually, xMin and and yMin have to be rounded down, a

Re: [ft] [ft-devel] heads-up: TrueType height computation has been fixed

2013-01-24 Thread Alexei Podtelezhnikov
On Thu, Jan 24, 2013 at 10:16 AM, Werner LEMBERG wrote: > >> I think that David's idea to make the change conditional can work >> except we should use a softer condition: [...] > > This is all moot. It was my error mixing up the glyph height with > the `height' value in FT_Face which actually is

Re: [ft] [ft-devel] heads-up: TrueType height computation has been fixed

2013-01-24 Thread Alexei Podtelezhnikov
On Thu, Jan 24, 2013 at 2:23 AM, Wojciech Mamrak wrote: > 2013/1/23 Alexei Podtelezhnikov : >> On Wed, Jan 23, 2013 at 10:50 AM, Wojciech Mamrak wrote: >>> What is the largest possible "height" change between the old and new >>> implementation? Can it exceed

Re: [ft] [ft-devel] heads-up: TrueType height computation has been fixed

2013-01-23 Thread Alexei Podtelezhnikov
On Wed, Jan 23, 2013 at 10:50 AM, Wojciech Mamrak wrote: > What is the largest possible "height" change between the old and new > implementation? Can it exceed one pixel? > It should not exceed 1 pixel unless the height specified in the font differs from (acsender - descender) by more than 1 pixe

Re: [ft] [ft-devel] heads-up: TrueType height computation has been fixed

2013-01-23 Thread Alexei Podtelezhnikov
On Wed, Jan 23, 2013 at 11:10 AM, David Turner wrote: > Unless I'm missing something (which is entirely possible, and I've not > looked at the patch details yet). > > If that so, maybe add some code to deal with this, e.g.: > > if (height_26.6 == ascender_26.6 - descender_26.6) { > height_in

Re: [ft] [ft-devel] heads-up: TrueType height computation has been fixed

2013-01-23 Thread Alexei Podtelezhnikov
On Wed, Jan 23, 2013 at 5:31 AM, Werner LEMBERG wrote: > just a heads-up which might influence applications: I've just fixed a > bug in the TrueType handler to correctly compute the `height' value of > the `FT_Face' structure... > > ...to be in sync with Windows. > > I wonder whether we should do

Re: [ft] [ft-devel] FreeType License and patents

2012-01-18 Thread Alexei Podtelezhnikov
On Fri, Jan 13, 2012 at 2:13 PM, Werner LEMBERG wrote: >  3. Grant of Patent License. > > Do freetype authors hold or have they filed for a patent? Don't you need it first before granting any patent license? This is one strange and curious discussion thread without a patent at hand. There is