![]() ![]() To get around the limitation, CSS allows the use of the rule. One weakness in the current implementation is that if two fonts have the same CSS property values, only the first is shown since there is no way to distinguish between the two using a PangoFontDescription. It handles things like CSS 'font-family' values that include fallbacks as well as finding the best font to substitute when a specified font is not available.Ī couple helper functions are also provided that are used in the GUI, including one that causes used fonts to be displayed in blue and unavailable fonts to be displayed with a red stike-through. The font_lister class sets up a Gtk::ListStore containing all the fonts available on the system and those used in an SVG file (which may include fonts not on the system). This glyph outline is used when rendering the glyph. Perhaps the most important function is font_instance::LoadGlyph() which provides access to glyph data including the glyph outline. The class functions provide access to font-wide data sush as the font's ascent, descent, and xheight. Like the Font Factory, the code depends on the the compile time flag USE_PANGO_WIN32. The font-instance class keeps track of a single font face. This is disabled except for the generic CSS faces ('sans-serif', 'serif', etc.). Pango is happy to synthesize bold and italic fonts. A few adjustments are made to match Pango to CSS (Sans -> sans-serif, etc.). Most of the rest of the Font Factory class code deals with extracting out information used for font selection in the GUI from the map such as a list of font families and their styles. As part of this process, the OpenType substitution tables are examined to build up a list of what glyph substitutions the font offers (this is not available when the USE_PANGO_WIN32 flag is set). The most important job of the Font Factory is to take the Pango description of a font (stored as a PangoFontDescription) and return a font_instance that matches the description (see next section). If the compile time flag USE_PANGO_WIN32 is set, the font factory uses pango_win32_xxx functions to create the map, otherwise pango_ft2_xxx functions are used. The Font Factory handles retrieving a list of fonts from the operating system and stores the list in a map. Font handling is partially operating system dependent.įont handling code is in the following files found in src/libnrtype: It relies on CSS properties applied to the element to define which shapes to fill.įonts are fundamental to the display of text. This method has the advantage that one can provide a natural fallback mechanism that works with SVG 1.1. A GSoC project aims to replace Flowed SVG 1.2 text with this type of text. ![]() This is text flowed inside a shape according to the rules of CSS. The code for this element is found in sp-textpath.h and sp-tspan.cpp. The code for the elements used in flowed text is found in src/sp-flowtext.cpp, src/sp-flowregion.cpp, and src/sp-flowdiv.cpp. The only know implementation other than Inkscape is in Batik (if the 'version' attribute is set to 1.2). No browser implemented this type of text. (One can also get multiline text by setting the 'white-space' property to preserve line feeds but there is no GUI and only Firefox supports this method.) The code for these elements is found in src/sp-text.cpp and src/sp-tspan.cpp. Multi-line text is mimicked by adding the attribute sodipodi:role="line" to each that represents a line. There are several distinct kinds of text in Inkscape: The Text and Font dialog code is in src/ui/dialog/text-edit.cpp. The text Toolbar code is in src/widgets/text-toolbar.cpp. ( nr stands for New Renderer.) The GUI code is distributed over a number of files: for interactive on-screen editing look in src/ui/tools/text-tool.cpp, src/text-editing.cpp, and src/text-chemistry.cpp. The actual rendering code is in src/drawing/drawing-text.cpp. Most of the code that handles text layout (including fonts) can be found in src/libnrtype. Layout the text, taking into consideration styling (font, font-size, etc.). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |