Application fonts with Pango+fontconfig

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Application fonts with Pango+fontconfig

Behdad Esfahbod-3
Hi all,

I am at the Libre Graphics Meeting in Toronto this week, which meant that I
got to talk to GIMP and Inkscape developers after many years, and was reminded
that Pango still doesn't make it easy to use custom (aka application fonts),
and it still does not allow one to turn OpenType features on or off.  So I
ended up doing a complete review of the stack, fixed small stuff, filed many
bugs, and documented it all.  Details here:

http://mces.blogspot.ca/2015/05/how-to-use-custom-application-fonts.html

Hopefully we can make the next release of the stack much better, and work with
app developers to integrate these.

Cheers,
--
behdad
http://behdad.org/
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Reply | Threaded
Open this post in threaded view
|

Re: Application fonts with Pango+fontconfig

davelab6

Wow, fantastic :)


_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Reply | Threaded
Open this post in threaded view
|

Re: [Fontconfig] Application fonts with Pango+fontconfig

Behdad Esfahbod-3
In reply to this post by Behdad Esfahbod-3
On 15-05-10 12:10 PM, Khaled Hosny wrote:

> On Fri, May 01, 2015 at 07:19:11PM -0400, Behdad Esfahbod wrote:
>> Hi all,
>>
>> I am at the Libre Graphics Meeting in Toronto this week, which meant that I
>> got to talk to GIMP and Inkscape developers after many years, and was reminded
>> that Pango still doesn't make it easy to use custom (aka application fonts),
>> and it still does not allow one to turn OpenType features on or off.  So I
>> ended up doing a complete review of the stack, fixed small stuff, filed many
>> bugs, and documented it all.  Details here:
>>
>> http://mces.blogspot.ca/2015/05/how-to-use-custom-application-fonts.html
>>
>> Hopefully we can make the next release of the stack much better, and work with
>> app developers to integrate these.
>
> I gave it a try[1] and it seems to work for my use case (I don’t even
> need to select a Pango font, since might is the only one Pango seems to
> just pick it), with one glitch: If the font gets changed while the
> viewer is open (e.g. adding or removing glyphs), Pango will start
> drawing garbage glyphs (seems to be using the old glyph indices) even
> though I recreate the config, fontmap, layout and everything. This is
> specially important for this application as I use it to test fonts while
> I’m working on them, not sure if it is that relevant for common use
> cases.

That's so weird.  How do you test this?

I just ran it, and if I copy a new font on top of the filename, the app
instantly picks it up (I'm not sure how!), but there doesn't seem to any issue
with glyph numbers.  I tested copying NotoNastaliq and IranNastaliq on top of
each other and it works just fine.

>
> This seems to be a general Pango issue, if I modify a font while
> an application is using it, I get similar issues.
>
> Regards,
> Khaled
>
> 1. https://github.com/khaledhosny/fontview/commit/0353750
>

--
behdad
http://behdad.org/
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Reply | Threaded
Open this post in threaded view
|

Re: [Fontconfig] Application fonts with Pango+fontconfig

Behdad Esfahbod-3
On 15-05-12 01:17 PM, Behdad Esfahbod wrote:

> On 15-05-10 12:10 PM, Khaled Hosny wrote:
>> On Fri, May 01, 2015 at 07:19:11PM -0400, Behdad Esfahbod wrote:
>>> Hi all,
>>>
>>> I am at the Libre Graphics Meeting in Toronto this week, which meant that I
>>> got to talk to GIMP and Inkscape developers after many years, and was reminded
>>> that Pango still doesn't make it easy to use custom (aka application fonts),
>>> and it still does not allow one to turn OpenType features on or off.  So I
>>> ended up doing a complete review of the stack, fixed small stuff, filed many
>>> bugs, and documented it all.  Details here:
>>>
>>> http://mces.blogspot.ca/2015/05/how-to-use-custom-application-fonts.html
>>>
>>> Hopefully we can make the next release of the stack much better, and work with
>>> app developers to integrate these.
>>
>> I gave it a try[1] and it seems to work for my use case (I don’t even
>> need to select a Pango font, since might is the only one Pango seems to
>> just pick it), with one glitch: If the font gets changed while the
>> viewer is open (e.g. adding or removing glyphs), Pango will start
>> drawing garbage glyphs (seems to be using the old glyph indices) even
>> though I recreate the config, fontmap, layout and everything. This is
>> specially important for this application as I use it to test fonts while
>> I’m working on them, not sure if it is that relevant for common use
>> cases.
>
> That's so weird.  How do you test this?
>
> I just ran it, and if I copy a new font on top of the filename, the app
> instantly picks it up (I'm not sure how!), but there doesn't seem to any issue
> with glyph numbers.  I tested copying NotoNastaliq and IranNastaliq on top of
> each other and it works just fine.

Ignore that.  I was testing with an old binary apparently.  Let me fix this.



>> This seems to be a general Pango issue, if I modify a font while
>> an application is using it, I get similar issues.
>>
>> Regards,
>> Khaled
>>
>> 1. https://github.com/khaledhosny/fontview/commit/0353750
>>
>

--
behdad
http://behdad.org/
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Reply | Threaded
Open this post in threaded view
|

Re: [Fontconfig] Application fonts with Pango+fontconfig

Behdad Esfahbod-3
In reply to this post by Behdad Esfahbod-3
On 15-05-10 12:10 PM, Khaled Hosny wrote:
>
> This seems to be a general Pango issue, if I modify a font while
> an application is using it, I get similar issues.

This sounds like caching inside cairo messing things up.  I'll think about it.
 Not sure how to best address it...

--
behdad
http://behdad.org/
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Reply | Threaded
Open this post in threaded view
|

Re: [Fontconfig] Application fonts with Pango+fontconfig

Behdad Esfahbod-3
On 15-05-13 06:17 AM, Khaled Hosny wrote:

> On Tue, May 12, 2015 at 03:34:59PM -0700, Behdad Esfahbod wrote:
>> On 15-05-10 12:10 PM, Khaled Hosny wrote:
>>>
>>> This seems to be a general Pango issue, if I modify a font while
>>> an application is using it, I get similar issues.
>>
>> This sounds like caching inside cairo messing things up.  I'll think about it.
>>  Not sure how to best address it...
>
> What is cached by cairo and how is that different from drawing the glyph
> on cairo directly rather than through pango-cairo?

In your old code you create FT_Face and pass it to cairo.  pangocairo however,
passes a FcPattern to cairo and let cairo create the FT_Face.  Cairo caches
FT_Face based on filename and face index, which obviously is broken here...

I have other issues with the cairo FT_Face handling to fix.  I might end up
considerably revamp cairo-ft internals (very tricky and time-consuming), or in
the mean time fix pangocairo to create its own FT_Face and pass to cairo.

--
behdad
http://behdad.org/
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list