OpenType Variable Fonts on Inkscape (and possibly other libre graphics tools)

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

OpenType Variable Fonts on Inkscape (and possibly other libre graphics tools)

Felipe Sanches-2
Hello, Inkscape friends,

== Intro ==
** You can skip this part if you already know me or if you don't
really care for the intro details :-D **

I've been active in Inkscape development a long time ago (circa
2007-2010, I think), but then I moved on to collaborate on other
projects such as GNU LibreDWG, FontForge, Metapolator, Kicad and a few
programs in the 3D printing toolchain such as Sprinter/Repetier
firmware, Pronterface and OpenSCAD. Also I'm regularly contributing to
the MAME Project and heavily interested in Coreboot/Libreboot, etc.
And during the past year and a half I've been developing and
maintaining the FontBakery project, a Quality-Assurance testsuite for
font families.

== LGM Brazil ==
Last month I've attended the Libre Graphics Meeting here in Brazil and
had the opportunity to meet a few GIMP developers. Unfortunately
no-one from the Inkscape team was there this time, other than the
couple of Brazilian past contributors (myself and Aurelio Heckert).

== Variable Fonts ==
Dave Crossland brought to my attention that there's an opportunity for
the "big four" libre graphics programs that heavily rely on typography
(Inkscape, GIMP, Scribus and LibreOffice) to implement support for
OpenType Font Variations (a.k.a. "variable fonts") before the
proprietary graphics applications do so.

It seems that while the major web-browsers are all already jumping
into the "variable fonts" technology, the proprietary graphics tools
are not so fast.

The underlying free software libraries already provide the support for
that. Harfbuzz did implement support on its January release, providing
a new API for OpenType variable fonts. I wonder if anyone here is
interested in getting involved in the implementation of support for
that in Inkscape.

== My plan for Variable Fonts in Inkscape (and perhaps GIMP) ==
With that in mind, I am planning to spend a full day per work-week
dealing with this. I have started to do so last week. I spent last
Thursday setting up my development machine to properly build GIMP and
Inkscape from source. I know Inkscape is moving into git at some point
very soon, but since it seems it did not happen yet, I decided to use
git-bzr to have my own local git tree, where I feel more comfortable
working.

Then I built several dependency libraries needed to build these
projects. GIMP still fails to build, but I already got Inkscape-devel
built and running. Nice to see the recent improvements someone did on
the measurement tool I implemented years ago. Thanks a lot!

After that, I read the relevant portions of the text-handling code in
Inkscape sources (most of it on the src/libnrtype/ directory). I see
that it relies on Pango for setting up font description
data-structures based on the user's font selection. And, if I got it
right, Pango uses HarfBuzz+Cairo as its underlying layout & rendering
backend.

So, my first thought is that we may add a variable fonts "bridge-API"
on pango that redirects the calls to the underlying harfbuzz
hb_ot_var_* API. Or the other alternative would be to entirely migrate
Inkscape code into using harfbuzz directly (ditching pango usage).
Please correct me if I misunderstood things here, but it seems to me
that both approaches could work, while the first is a quick and dirty
hack while the second would be the nicer way of doing things even
though it would require a larger coding effort.

I'm copying Behdad Esfahbod in this thread as he is the developer of
both Pango and HarfBuzz and may be interested in commenting on this.

Happy Hacking,
Felipe "Juca" Sanches

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: OpenType Variable Fonts on Inkscape (and possibly other libre graphics tools)

Tavmjong Bah
On Wed, 2017-05-03 at 11:06 -0300, Felipe Sanches wrote:
> Hello, Inkscape friends,
>
> == Intro ==
> ** You can skip this part if you already know me or if you don't
> really care for the intro details :-D **

Glad to see you back!

> I've been active in Inkscape development a long time ago (circa
> 2007-2010, I think), but then I moved on to collaborate on other
> projects such as GNU LibreDWG, FontForge, Metapolator, Kicad and a
> few
> programs in the 3D printing toolchain such as Sprinter/Repetier
> firmware, Pronterface and OpenSCAD. Also I'm regularly contributing
> to
> the MAME Project and heavily interested in Coreboot/Libreboot, etc.
> And during the past year and a half I've been developing and
> maintaining the FontBakery project, a Quality-Assurance testsuite for
> font families.
>
> == LGM Brazil ==
> Last month I've attended the Libre Graphics Meeting here in Brazil
> and
> had the opportunity to meet a few GIMP developers. Unfortunately
> no-one from the Inkscape team was there this time, other than the
> couple of Brazilian past contributors (myself and Aurelio Heckert).
>
> == Variable Fonts ==
> Dave Crossland brought to my attention that there's an opportunity
> for
> the "big four" libre graphics programs that heavily rely on
> typography
> (Inkscape, GIMP, Scribus and LibreOffice) to implement support for
> OpenType Font Variations (a.k.a. "variable fonts") before the
> proprietary graphics applications do so.
>
> It seems that while the major web-browsers are all already jumping
> into the "variable fonts" technology, the proprietary graphics tools
> are not so fast.
>
> The underlying free software libraries already provide the support
> for
> that. Harfbuzz did implement support on its January release,
> providing
> a new API for OpenType variable fonts. I wonder if anyone here is
> interested in getting involved in the implementation of support for
> that in Inkscape.

Personally, I'm not so sure about the utility of variable fonts but
given that browsers are supporting them, we probably should too (I
question how many high quality variable fonts will be available).
Getting a jump on propriety software is never a bad idea.

> == My plan for Variable Fonts in Inkscape (and perhaps GIMP) ==
> With that in mind, I am planning to spend a full day per work-week
> dealing with this. I have started to do so last week. I spent last
> Thursday setting up my development machine to properly build GIMP and
> Inkscape from source. I know Inkscape is moving into git at some
> point
> very soon, but since it seems it did not happen yet, I decided to use
> git-bzr to have my own local git tree, where I feel more comfortable
> working.
>
> Then I built several dependency libraries needed to build these
> projects. GIMP still fails to build, but I already got Inkscape-devel
> built and running. Nice to see the recent improvements someone did on
> the measurement tool I implemented years ago. Thanks a lot!
>
> After that, I read the relevant portions of the text-handling code in
> Inkscape sources (most of it on the src/libnrtype/ directory). I see
> that it relies on Pango for setting up font description
> data-structures based on the user's font selection. And, if I got it
> right, Pango uses HarfBuzz+Cairo as its underlying layout & rendering
> backend.

Yes.

> So, my first thought is that we may add a variable fonts "bridge-API"
> on pango that redirects the calls to the underlying harfbuzz
> hb_ot_var_* API. Or the other alternative would be to entirely
> migrate
> Inkscape code into using harfbuzz directly (ditching pango usage).
> Please correct me if I misunderstood things here, but it seems to me
> that both approaches could work, while the first is a quick and dirty
> hack while the second would be the nicer way of doing things even
> though it would require a larger coding effort.

I would be in favor of using harfbuzz directly. It seems that this is
the direction things are going... but it would take quite a bit of
effort as we rely heavily on Pango for font selection (following CSS
rules). And I'm not sure if harfbuzz can handle things like CSS font
lists ("Time New Roman, serif").

We already use harfbuzz to access font variant information (in a quite
awkward way).

How do you plan on handling selecting the parameters for variable
fonts? We currently have no support for @font-face (this is something I
would love to see added).


> I'm copying Behdad Esfahbod in this thread as he is the developer of
> both Pango and HarfBuzz and may be interested in commenting on this.

Note that we will have a GSoC student working on moving our SVG 1.2
text layout to SVG 2 this summer.

Tav

> Happy Hacking,
> Felipe "Juca" Sanches
>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
C R
Reply | Threaded
Open this post in threaded view
|

Re: OpenType Variable Fonts on Inkscape (and possibly other libre graphics tools)

C R
Jabier and I were talking about this. This is particularly good for
fonts that look hand-written already. Adding slight variation means
that you can type without having to write, and have it still appear as
if it was written by hand.
No, it's probably not useful for all fonts, but I don't think that
should stop implementation. I'd love to see this feature come to
Inkscape, and I know it would be a big selling point for commercial
graphics folks, especially considering the proliferation of
hand-written type in commercial graphics. Everyone wants that
home-made, hand-crafted (whatever) look. This is exactly that.

Thanks for all your work!
-C

On Fri, May 5, 2017 at 9:30 AM, Tavmjong Bah <[hidden email]> wrote:

> On Wed, 2017-05-03 at 11:06 -0300, Felipe Sanches wrote:
>> Hello, Inkscape friends,
>>
>> == Intro ==
>> ** You can skip this part if you already know me or if you don't
>> really care for the intro details :-D **
>
> Glad to see you back!
>
>> I've been active in Inkscape development a long time ago (circa
>> 2007-2010, I think), but then I moved on to collaborate on other
>> projects such as GNU LibreDWG, FontForge, Metapolator, Kicad and a
>> few
>> programs in the 3D printing toolchain such as Sprinter/Repetier
>> firmware, Pronterface and OpenSCAD. Also I'm regularly contributing
>> to
>> the MAME Project and heavily interested in Coreboot/Libreboot, etc.
>> And during the past year and a half I've been developing and
>> maintaining the FontBakery project, a Quality-Assurance testsuite for
>> font families.
>>
>> == LGM Brazil ==
>> Last month I've attended the Libre Graphics Meeting here in Brazil
>> and
>> had the opportunity to meet a few GIMP developers. Unfortunately
>> no-one from the Inkscape team was there this time, other than the
>> couple of Brazilian past contributors (myself and Aurelio Heckert).
>>
>> == Variable Fonts ==
>> Dave Crossland brought to my attention that there's an opportunity
>> for
>> the "big four" libre graphics programs that heavily rely on
>> typography
>> (Inkscape, GIMP, Scribus and LibreOffice) to implement support for
>> OpenType Font Variations (a.k.a. "variable fonts") before the
>> proprietary graphics applications do so.
>>
>> It seems that while the major web-browsers are all already jumping
>> into the "variable fonts" technology, the proprietary graphics tools
>> are not so fast.
>>
>> The underlying free software libraries already provide the support
>> for
>> that. Harfbuzz did implement support on its January release,
>> providing
>> a new API for OpenType variable fonts. I wonder if anyone here is
>> interested in getting involved in the implementation of support for
>> that in Inkscape.
>
> Personally, I'm not so sure about the utility of variable fonts but
> given that browsers are supporting them, we probably should too (I
> question how many high quality variable fonts will be available).
> Getting a jump on propriety software is never a bad idea.
>
>> == My plan for Variable Fonts in Inkscape (and perhaps GIMP) ==
>> With that in mind, I am planning to spend a full day per work-week
>> dealing with this. I have started to do so last week. I spent last
>> Thursday setting up my development machine to properly build GIMP and
>> Inkscape from source. I know Inkscape is moving into git at some
>> point
>> very soon, but since it seems it did not happen yet, I decided to use
>> git-bzr to have my own local git tree, where I feel more comfortable
>> working.
>>
>> Then I built several dependency libraries needed to build these
>> projects. GIMP still fails to build, but I already got Inkscape-devel
>> built and running. Nice to see the recent improvements someone did on
>> the measurement tool I implemented years ago. Thanks a lot!
>>
>> After that, I read the relevant portions of the text-handling code in
>> Inkscape sources (most of it on the src/libnrtype/ directory). I see
>> that it relies on Pango for setting up font description
>> data-structures based on the user's font selection. And, if I got it
>> right, Pango uses HarfBuzz+Cairo as its underlying layout & rendering
>> backend.
>
> Yes.
>
>> So, my first thought is that we may add a variable fonts "bridge-API"
>> on pango that redirects the calls to the underlying harfbuzz
>> hb_ot_var_* API. Or the other alternative would be to entirely
>> migrate
>> Inkscape code into using harfbuzz directly (ditching pango usage).
>> Please correct me if I misunderstood things here, but it seems to me
>> that both approaches could work, while the first is a quick and dirty
>> hack while the second would be the nicer way of doing things even
>> though it would require a larger coding effort.
>
> I would be in favor of using harfbuzz directly. It seems that this is
> the direction things are going... but it would take quite a bit of
> effort as we rely heavily on Pango for font selection (following CSS
> rules). And I'm not sure if harfbuzz can handle things like CSS font
> lists ("Time New Roman, serif").
>
> We already use harfbuzz to access font variant information (in a quite
> awkward way).
>
> How do you plan on handling selecting the parameters for variable
> fonts? We currently have no support for @font-face (this is something I
> would love to see added).
>
>
>> I'm copying Behdad Esfahbod in this thread as he is the developer of
>> both Pango and HarfBuzz and may be interested in commenting on this.
>
> Note that we will have a GSoC student working on moving our SVG 1.2
> text layout to SVG 2 this summer.
>
> Tav
>
>> Happy Hacking,
>> Felipe "Juca" Sanches
>>
>>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Inkscape-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/inkscape-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: OpenType Variable Fonts on Inkscape (and possibly other libre graphics tools)

Tavmjong Bah
On Fri, 2017-05-05 at 09:38 +0100, C R wrote:

> Jabier and I were talking about this. This is particularly good for
> fonts that look hand-written already. Adding slight variation means
> that you can type without having to write, and have it still appear
> as
> if it was written by hand.
> No, it's probably not useful for all fonts, but I don't think that
> should stop implementation. I'd love to see this feature come to
> Inkscape, and I know it would be a big selling point for commercial
> graphics folks, especially considering the proliferation of
> hand-written type in commercial graphics. Everyone wants that
> home-made, hand-crafted (whatever) look. This is exactly that.

I don't see how this helps with "hand-written" fonts. The variations
(weight, slant) are applied uniformly to all glyphs unless you
explicitly apply them letter-by-letter. If you want to make something
look more handwritten, apply a filter that uses the displacement map
filter using the turbulence filter as input. See the bottom of:

        http://tavmjong.free.fr/blog/?p=1451

Tav

> Thanks for all your work!
> -C
>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
C R
Reply | Threaded
Open this post in threaded view
|

Re: OpenType Variable Fonts on Inkscape (and possibly other libre graphics tools)

C R
Ah, I've clearly misunderstood what this is for.
Though it would certainly be great to increase the weight of a font
without having to adjust the outline, for example. Our engravers will
be quite happy. :)

-C

On Fri, May 5, 2017 at 10:15 AM, Tavmjong Bah <[hidden email]> wrote:

> On Fri, 2017-05-05 at 09:38 +0100, C R wrote:
>> Jabier and I were talking about this. This is particularly good for
>> fonts that look hand-written already. Adding slight variation means
>> that you can type without having to write, and have it still appear
>> as
>> if it was written by hand.
>> No, it's probably not useful for all fonts, but I don't think that
>> should stop implementation. I'd love to see this feature come to
>> Inkscape, and I know it would be a big selling point for commercial
>> graphics folks, especially considering the proliferation of
>> hand-written type in commercial graphics. Everyone wants that
>> home-made, hand-crafted (whatever) look. This is exactly that.
>
> I don't see how this helps with "hand-written" fonts. The variations
> (weight, slant) are applied uniformly to all glyphs unless you
> explicitly apply them letter-by-letter. If you want to make something
> look more handwritten, apply a filter that uses the displacement map
> filter using the turbulence filter as input. See the bottom of:
>
>         http://tavmjong.free.fr/blog/?p=1451
>
> Tav
>
>> Thanks for all your work!
>> -C
>>
>>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: OpenType Variable Fonts on Inkscape (and possibly other libre graphics tools)

Felipe Sanches-2
In reply to this post by Tavmjong Bah
2017-05-05 5:30 GMT-03:00 Tavmjong Bah <[hidden email]>:

> I would be in favor of using harfbuzz directly. It seems that this is
> the direction things are going... but it would take quite a bit of
> effort as we rely heavily on Pango for font selection (following CSS
> rules). And I'm not sure if harfbuzz can handle things like CSS font
> lists ("Time New Roman, serif").
>
> We already use harfbuzz to access font variant information (in a quite
> awkward way).
>
> How do you plan on handling selecting the parameters for variable
> fonts? We currently have no support for @font-face (this is something I
> would love to see added).

This is still something I need to figure out.

>> I'm copying Behdad Esfahbod in this thread as he is the developer of
>> both Pango and HarfBuzz and may be interested in commenting on this.
>
> Note that we will have a GSoC student working on moving our SVG 1.2
> text layout to SVG 2 this summer.

Cool! Who's the student? And who's the mentor?
I should get in contact with both of them, ideally.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: OpenType Variable Fonts on Inkscape (and possibly other libre graphics tools)

Behdad Esfahbod-3
In reply to this post by Tavmjong Bah
Hi Tav, others,

While using HarfBuzz directly will give you a lot of flexibility, it's also a nontrivial amount of work to duplicate what Pango does already.  It's true that some of the newer features of HarfBuzz will probably take forever to be wired up in Pango.  Like variations indeed.  But maybe Inkscape people can help wiring those up in Pango instead of investing a lot of time replacing it?

On Fri, May 5, 2017 at 1:30 AM, Tavmjong Bah <[hidden email]> wrote:
On Wed, 2017-05-03 at 11:06 -0300, Felipe Sanches wrote:
> Hello, Inkscape friends,
>
> == Intro ==
> ** You can skip this part if you already know me or if you don't
> really care for the intro details :-D **

Glad to see you back!

> I've been active in Inkscape development a long time ago (circa
> 2007-2010, I think), but then I moved on to collaborate on other
> projects such as GNU LibreDWG, FontForge, Metapolator, Kicad and a
> few
> programs in the 3D printing toolchain such as Sprinter/Repetier
> firmware, Pronterface and OpenSCAD. Also I'm regularly contributing
> to
> the MAME Project and heavily interested in Coreboot/Libreboot, etc.
> And during the past year and a half I've been developing and
> maintaining the FontBakery project, a Quality-Assurance testsuite for
> font families.
>
> == LGM Brazil ==
> Last month I've attended the Libre Graphics Meeting here in Brazil
> and
> had the opportunity to meet a few GIMP developers. Unfortunately
> no-one from the Inkscape team was there this time, other than the
> couple of Brazilian past contributors (myself and Aurelio Heckert).
>
> == Variable Fonts ==
> Dave Crossland brought to my attention that there's an opportunity
> for
> the "big four" libre graphics programs that heavily rely on
> typography
> (Inkscape, GIMP, Scribus and LibreOffice) to implement support for
> OpenType Font Variations (a.k.a. "variable fonts") before the
> proprietary graphics applications do so.
>
> It seems that while the major web-browsers are all already jumping
> into the "variable fonts" technology, the proprietary graphics tools
> are not so fast.
>
> The underlying free software libraries already provide the support
> for
> that. Harfbuzz did implement support on its January release,
> providing
> a new API for OpenType variable fonts. I wonder if anyone here is
> interested in getting involved in the implementation of support for
> that in Inkscape.

Personally, I'm not so sure about the utility of variable fonts but
given that browsers are supporting them, we probably should too (I
question how many high quality variable fonts will be available).
Getting a jump on propriety software is never a bad idea.

> == My plan for Variable Fonts in Inkscape (and perhaps GIMP) ==
> With that in mind, I am planning to spend a full day per work-week
> dealing with this. I have started to do so last week. I spent last
> Thursday setting up my development machine to properly build GIMP and
> Inkscape from source. I know Inkscape is moving into git at some
> point
> very soon, but since it seems it did not happen yet, I decided to use
> git-bzr to have my own local git tree, where I feel more comfortable
> working.
>
> Then I built several dependency libraries needed to build these
> projects. GIMP still fails to build, but I already got Inkscape-devel
> built and running. Nice to see the recent improvements someone did on
> the measurement tool I implemented years ago. Thanks a lot!
>
> After that, I read the relevant portions of the text-handling code in
> Inkscape sources (most of it on the src/libnrtype/ directory). I see
> that it relies on Pango for setting up font description
> data-structures based on the user's font selection. And, if I got it
> right, Pango uses HarfBuzz+Cairo as its underlying layout & rendering
> backend.

Yes.

> So, my first thought is that we may add a variable fonts "bridge-API"
> on pango that redirects the calls to the underlying harfbuzz
> hb_ot_var_* API. Or the other alternative would be to entirely
> migrate
> Inkscape code into using harfbuzz directly (ditching pango usage).
> Please correct me if I misunderstood things here, but it seems to me
> that both approaches could work, while the first is a quick and dirty
> hack while the second would be the nicer way of doing things even
> though it would require a larger coding effort.

I would be in favor of using harfbuzz directly. It seems that this is
the direction things are going... but it would take quite a bit of
effort as we rely heavily on Pango for font selection (following CSS
rules). And I'm not sure if harfbuzz can handle things like CSS font
lists ("Time New Roman, serif").

We already use harfbuzz to access font variant information (in a quite
awkward way).

How do you plan on handling selecting the parameters for variable
fonts? We currently have no support for @font-face (this is something I
would love to see added).


> I'm copying Behdad Esfahbod in this thread as he is the developer of
> both Pango and HarfBuzz and may be interested in commenting on this.

Note that we will have a GSoC student working on moving our SVG 1.2
text layout to SVG 2 this summer.

Tav

> Happy Hacking,
> Felipe "Juca" Sanches
>
>



--

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel