Re: Variable Fonts

2023-01-09 Thread Werner LEMBERG


> Now that I researched more, I cannot cache glyphs of different
> variations inside the cache manager unless I provide a different
> face_id for each variation and only then my system works correctly.
> To be honest this is a flaw in the cache subsystem of the freetype
> library.

Please open an issue in the FreeType tracker at
https://gitlab.freedesktop.org/freetype/freetype/-/issues

And of course, patches are welcomed :-)


Werner



Re: Variable Fonts

2023-01-09 Thread Tulsi Amin
Hello,
Now that I researched more, I cannot cache glyphs of different variations
inside the cache manager unless I provide a different face_id for each
variation and only then my system works correctly. To be honest this is a
flaw in the cache subsystem of the freetype library. You need to provide a
way to cache the glyphs of different variations and identify them uniquely
as well. Please let me know your thoughts on this. The caching system
should work well with variable fonts. Currently what I have done seems like
a hack make it work.

Thank You,
Tulsi Amin

On Mon, Jan 9, 2023 at 10:04 AM Tulsi Amin  wrote:

> Hello,
>
> I have another question related to variable fonts.
> My current implementation maps a face_id with a font variation defined by
> me.
> For example,
> Bold is a variation with weight axis value 1.0 and SemiBold is a variation
> with weight axis value 0.8 and I input a different face_id for each of the
> variation when I call  FTC_Manager_LookupFace() function so that it can
> cache glyphs of both the variations but I also think that a face_id should
> be different only when we are loading a different font file and not when we
> are applying different variations. I am a bit confused if my implementation
> should cache glyphs of both the variations in the freetype cache manager
> without changing the face_id. Please let me know.
>
> FTC_Manager_LookupFace() - here I send different face_id for different
> variations though they belong to the same font resource file(I mean the
> same .ttf)
>
> Thank You,
> Tulsi Amin
>


Re: Variable fonts

2023-01-09 Thread Tulsi Amin
Hello,

I agree with you and thanks for the clarification.

Thank You,
Tulsi Amin

On Mon, 9 Jan, 2023, 09:06 Werner LEMBERG,  wrote:

>
> > I am currently using the multiple master feature of freetype library
> > to support the variable fonts.  There is an issue that I am facing
> > currently.  For an example, consider that I am making letter "A"
> > bold using the weight axis but in my system I want to be able to
> > uniquely identify the default normal "A" and the bold "A" but since
> > the unicode id will be same for both normal "A" and bold "A", Is
> > freetype library providing any other identifier which can uniquely
> > identify them?
>
> No.  How should FreeType do that?  You input a glyph index, and the
> library returns a rasterized image of the glyph, nothing more.  All
> information FreeType can give is in the `FT_Face` structure and its
> related sub-structures and siblings.
>
> Such 'tagging' must be done at a higher library level: essentially,
> it's you who specifies the parameters for the variable font, so it's
> you who has to track them, too.
>
>
> Werner
>


Re: Variable fonts

2023-01-09 Thread Werner LEMBERG


> I am currently using the multiple master feature of freetype library
> to support the variable fonts.  There is an issue that I am facing
> currently.  For an example, consider that I am making letter "A"
> bold using the weight axis but in my system I want to be able to
> uniquely identify the default normal "A" and the bold "A" but since
> the unicode id will be same for both normal "A" and bold "A", Is
> freetype library providing any other identifier which can uniquely
> identify them?

No.  How should FreeType do that?  You input a glyph index, and the
library returns a rasterized image of the glyph, nothing more.  All
information FreeType can give is in the `FT_Face` structure and its
related sub-structures and siblings.

Such 'tagging' must be done at a higher library level: essentially,
it's you who specifies the parameters for the variable font, so it's
you who has to track them, too.


Werner