Sunday, March 9, 2008

Summer Coding Fun Ahead

This year's Google Summer of Code official announcement has come and gone. Would-be participating open source organizations are applying in a flurry to be one of the relative few that will become mentors to hundreds of students this summer. And me? I'm hoping to propose more work on Inkscape's text tool to go with what I did last summer.

In particular, I would very much like to continue the quest of supporting non-CSS fonts in Inkscape. In the current build, I have an extra custom CSS attribute added to text elements that holds the full name of the font used. Without this, font information can be lost, since CSS can store a font family and only a limited number of style and type attributes. Fancy font variants will have style and type values that simply can't be represented, and so some generic alternative will be used. Other than the obvious problem of dumbing down more interesting fonts, you can imagine that the general style and type defaults might not even exist for this family, making it completely unusable.

So we store the whole font name to ensure that no information is lost. Unfortunately, Inkscape internally makes use of the Pango font system, which seems to - you guessed it - only support fonts that CSS can support. Fonts are represented in memory with Pango structures, and the system is fairly heavily intertwined with Inkscape font code. I would not suggest removing Pango from the Inkscape equation, so this leaves me with one choice: see if we can expand Pango to include a bigger variety of fonts!

I have contacted the Pango folks on their mailing list, and am awaiting their reply. I am trying to find out whether this expansion would be desirable for Pango. For all I know, there could be some philosophical or even technical barriers to doing it. If I get some good news back, I would like to propose working on this expansion during this year's Summer of Code. Ultimately, this would mean being able to support some cool fonts in Inkscape.

I will let you know what happens!

2 comments:

ARBaboon said...

I'm confused. Pango is only concerned with layout and abstraction. Pango passes on arbitrary attributes to the backend and rendering engine. Could those not just be any values like panose values, etc.?

Gail said...

Here is an example of what I am talking about. Inkscape uses these Pango font descriptions (see page as a whole) to represent information about fonts in memory. If a font has a variant other than small caps (for this example), say "swash" or something, you can't represent the exact font using these enums. You end up getting a default as a fall-back. All I'd really like to do is expand what can be stored to some more commonly known variants etc. Can you ever catch everything? No, but we could catch more.

Post a Comment

Comments are moderated - please be patient while I approve yours.