diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-03-10 20:36:05 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Zenotz <jtx@jtx.marker.es> | 2013-03-10 20:36:05 +0000 |
| commit | 8db86f8405ff74e590566bfd552d1c23f00bdf5b (patch) | |
| tree | 2913da86831eb11925cdc4d978982507dfe8e751 /src/libnrtype | |
| parent | Add pencil BSpline mode (diff) | |
| parent | Migrate Object Properties dialog to Gtk::Grid (diff) | |
| download | inkscape-8db86f8405ff74e590566bfd552d1c23f00bdf5b.tar.gz inkscape-8db86f8405ff74e590566bfd552d1c23f00bdf5b.zip | |
Merge from trunk
(bzr r11950.1.50)
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/FontFactory.cpp | 17 | ||||
| -rw-r--r-- | src/libnrtype/font-lister.cpp | 14 |
2 files changed, 19 insertions, 12 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index a1a9ddc89..bb8b0887f 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -741,16 +741,23 @@ void font_factory::GetUIFamiliesAndStyles(FamilyToStylesMap *map) continue; } - // Disable synthesized (faux) font faces - if (pango_font_face_is_synthesized(faces[currentFace]) ) { - continue; - } - PangoFontDescription *faceDescr = pango_font_face_describe(faces[currentFace]); if (faceDescr) { Glib::ustring familyUIName = GetUIFamilyString(faceDescr); Glib::ustring styleUIName = GetUIStyleString(faceDescr); + // Disable synthesized (faux) font faces except for CSS generic faces + if (pango_font_face_is_synthesized(faces[currentFace]) ) { + if( familyUIName.compare( "sans-serif" ) != 0 && + familyUIName.compare( "serif" ) != 0 && + familyUIName.compare( "monospace" ) != 0 && + familyUIName.compare( "fantasy" ) != 0 && + familyUIName.compare( "cursive" ) != 0 ) { + //std::cout << "faux: " << familyUIName << " | " << styleUIName << std::endl; + continue; + } + } + if (!familyUIName.empty() && !styleUIName.empty()) { // Find the right place to put the style information, adding diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp index 1e3ba01e9..712c17915 100644 --- a/src/libnrtype/font-lister.cpp +++ b/src/libnrtype/font-lister.cpp @@ -556,13 +556,13 @@ namespace Inkscape PangoWeight weight = pango_font_description_get_weight( desc ); switch ( weight ) { case PANGO_WEIGHT_THIN: - sp_repr_css_set_property (css, "font-weight", "100" ); + sp_repr_css_set_property (css, "font-weight", "thin" ); break; case PANGO_WEIGHT_ULTRALIGHT: - sp_repr_css_set_property (css, "font-weight", "200" ); + sp_repr_css_set_property (css, "font-weight", "extra light" ); break; case PANGO_WEIGHT_LIGHT: - sp_repr_css_set_property (css, "font-weight", "300" ); + sp_repr_css_set_property (css, "font-weight", "light" ); break; case PANGO_WEIGHT_BOOK: sp_repr_css_set_property (css, "font-weight", "380" ); @@ -571,19 +571,19 @@ namespace Inkscape sp_repr_css_set_property (css, "font-weight", "normal" ); break; case PANGO_WEIGHT_MEDIUM: - sp_repr_css_set_property (css, "font-weight", "500" ); + sp_repr_css_set_property (css, "font-weight", "medium" ); break; case PANGO_WEIGHT_SEMIBOLD: - sp_repr_css_set_property (css, "font-weight", "600" ); + sp_repr_css_set_property (css, "font-weight", "semi bold" ); break; case PANGO_WEIGHT_BOLD: sp_repr_css_set_property (css, "font-weight", "bold" ); break; case PANGO_WEIGHT_ULTRABOLD: - sp_repr_css_set_property (css, "font-weight", "800" ); + sp_repr_css_set_property (css, "font-weight", "extra bold" ); break; case PANGO_WEIGHT_HEAVY: - sp_repr_css_set_property (css, "font-weight", "900" ); + sp_repr_css_set_property (css, "font-weight", "black" ); break; case PANGO_WEIGHT_ULTRAHEAVY: sp_repr_css_set_property (css, "font-weight", "1000" ); |
