Continuing the font system cleanup, today I checked in a fairly large chunk of code:
1. All CSS font properties (style, weight, stretch, variant) are now fully supported. This support is somewhat flakey in that when you change a font of a text object, the properties get their values from parsing the style name of the font, assuming the name uses more or less standard terms (and is in English). This is currently unavoidable, because the Xft back-end provides no information about the font style except italic and bold bits, which is clearly insufficient for our purposes. When we switch to Pango, we'll be able to get from it an exact match for the CSS properties, but it needs to be tested how reliable is this information from Pango (it may well be that parsing the name, although ugly, is still more reliable). Similarly, when Inkscape reads a CSS font specification from SVG, it finds the most appropriate font based on the name only.
So, now Inkscape can see, apply, and read from SVG a lot more fonts and styles than before. It still cannot handle _all_ fonts, but the limit of the CSS syntax is reached, and further improvement is only possible if we introduce an inkscape:font-style extension attribute. Perhaps I will do this next.
2. The matching algorithm that finds the most appropriate family and style is much improved. If there's no exact family match, Inkscape now uses partial matches (e.g. "Times New Roman" if SVG specifies "times", or "Adobe Garamond" if the file requires "Garamond", or vice versa), of which it selects the family with the shortest name. Inkscape now knows more standard families (most importantly Bitstream Vera, but also Luxi and Windows standard fonts) and uses one of them when all else fails. It also attempts to avoid using fancy fonts (such as monospace, outline, etc) when not asked, so as to prevent funny font substitutions. Finally, it now understands and tries to obey generic font families (serif, sans-serif, monospace) and can parse multiple families in one specification (e.g. "font-family:garamond,times,serif") finding the best match for all listed families. With matching style, it will match "italic" when you specify "oblique" but no oblique is available, and vice versa, and will find the closes stretch and weight match among the available styles.
3. Whenever an inexact family/style match is chosen, Inkscape will now display a g_warning showing what font was required and what is being used instead. You will probably get a lot of such warnings for your old files, because older versions of inkscape/sodipodi often included bogus and unnecessary font references. Newly created files should be OK (at least when viewed on the same system). In particular, there were warnings in icons.svg, tutorial.svg and about.svg; I cleaned them all up so please do "make install" again.
If you get some suspicious font substitution or any other font problem, contact me at once.
_________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2...