Re: [Inquiry] Auto-fit on monochrome output

2023-11-07 Thread Werner LEMBERG
>> No, (good) auto-hinting is not available for monochrome display.
> 
> Does this mean even if I load the glyph with FT_LOAD_FORCE_AUTOHINT,
> the autofit algorithm also will not perform any hinting?

It will perform hinting but expect very ugly results.

> I'm using the TrueType font, any way to improve the hinting other
> than FT_LOAD_TARGET_MONO?

Define 'improve hinting'.  It's not clear to me what you actually want
to achieve.

>> A segmentation fault shouldn't happen; I guess you are forgetting
>> to check a return value somewhere.  If the problem persists please
>> provide a small stand-alone code snippet for testing purposes that
>> I can compile and run on the command line.
> 
> bad case : Segmentation fault "potentially unexpected fatal signal 11"
>  -->tried with combination of
> FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT
> FT_LOAD_RENDER | FT_LOAD_TARGET_MONO | FT_LOAD_FORCE_AUTOHINT
> FT_LOAD_RENDER | FT_LOAD_MONOCHROME | FT_LOAD_FORCE_AUTOHINT

Thanks, but these images don't help in any way to identify a possible
bug in FreeType.  As I said, I need a small, compilable, stand-alone
snippet (written in C) that runs on the command line and exhibits the
problem.  This means some work on your side to reduce your code as
much as possible – you are done if removing anything from the example
no longer triggers the problem.


   Werner


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 bitmaps produced for shifted outlines and stacked
together. Therefore, you have it already for 1/3-pixel shifts by
default. Because everything is periodic, you can continue with the LCD
output and clever reading frame shifts for subpixel positioning too.

Theoretically, this should work.

There is also 
https://freetype.org/freetype2/docs/reference/ft2-sizing_and_scaling.html#ft_set_transform
.  Perhaps you should wrap it into
https://freetype.org/freetype2/docs/reference/ft2-cache_subsystem.html#ftc_face_requester.

Alexei



Re: [Inquiry] Auto-fit on monochrome output

2023-11-07 Thread Jm Moon
> No, (good) auto-hinting is not available for monochrome display.

Does this mean even if I load the glyph with FT_LOAD_FORCE_AUTOHINT, the
autofit algorithm also will not perform any hinting?
I'm using the TrueType font, any way to improve the hinting other than
FT_LOAD_TARGET_MONO?

> A segmentation fault shouldn't happen; I guess you are forgetting to
check a return value somewhere.  If the problem persists please
provide a small stand-alone code snippet for testing purposes that I
can compile and run on the command line.

bad case : Segmentation fault "potentially unexpected fatal signal 11"
 -->tried with combination of
FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT
FT_LOAD_RENDER | FT_LOAD_TARGET_MONO | FT_LOAD_FORCE_AUTOHINT
FT_LOAD_RENDER | FT_LOAD_MONOCHROME | FT_LOAD_FORCE_AUTOHINT
[image: image.png]

Good case
[image: image.png]


Thank You.

Best Regards
JM Moon


On Wed, 8 Nov 2023 at 00:20, Werner LEMBERG  wrote:

>
> > I am exploring this FreeType font engine library, am wondering if the
> > auto-fit(auto-hint) support for monochrome display as well?
>
> No, (good) auto-hinting is not available for monochrome display.
>
> > I get segmentation fault whenever I use this flag ->
> > FT_LOAD_FORCE_AUTOHINT
> >
> > FT_LOAD_RENDER | FT_LOAD_MONOCHROME | FT_LOAD_FORCE_AUTOHINT
>
> A segmentation fault shouldn't happen; I guess you are forgetting to
> check a return value somewhere.  If the problem persists please
> provide a small stand-alone code snippet for testing purposes that I
> can compile and run on the command line.
>
>
> Werner
>


Re: [Inquiry] Auto-fit on monochrome output

2023-11-07 Thread Werner LEMBERG


> I am exploring this FreeType font engine library, am wondering if the
> auto-fit(auto-hint) support for monochrome display as well?

No, (good) auto-hinting is not available for monochrome display.

> I get segmentation fault whenever I use this flag ->
> FT_LOAD_FORCE_AUTOHINT
> 
> FT_LOAD_RENDER | FT_LOAD_MONOCHROME | FT_LOAD_FORCE_AUTOHINT

A segmentation fault shouldn't happen; I guess you are forgetting to
check a return value somewhere.  If the problem persists please
provide a small stand-alone code snippet for testing purposes that I
can compile and run on the command line.


Werner



[Inquiry] Auto-fit on monochrome output

2023-11-07 Thread Jm Moon
Hi,

I am exploring this FreeType font engine library, am wondering if the
auto-fit(auto-hint) support for monochrome display as well?
I get segmentation fault whenever I use this flag -> FT_LOAD_FORCE_AUTOHINT

FT_LOAD_RENDER | FT_LOAD_MONOCHROME | FT_LOAD_FORCE_AUTOHINT

Thank You.

Best Regards
JM Moon