diff options
-rw-r--r-- | docs/pango.toml.in | 12 | ||||
-rw-r--r-- | docs/pangocairo.toml.in | 2 | ||||
-rw-r--r-- | docs/pangofc.toml.in | 2 | ||||
-rw-r--r-- | docs/pangoft2.toml.in | 2 | ||||
-rw-r--r-- | docs/pangoxft.toml.in | 2 | ||||
-rw-r--r-- | pango/break.c | 5 | ||||
-rw-r--r-- | pango/pangocairo-win32font.c | 1 | ||||
-rw-r--r-- | pango/pangowin32-dwrite-fontmap.cpp | 74 | ||||
-rw-r--r-- | pango/pangowin32.c | 19 |
9 files changed, 54 insertions, 65 deletions
diff --git a/docs/pango.toml.in b/docs/pango.toml.in index 77b860a2..328e22f2 100644 --- a/docs/pango.toml.in +++ b/docs/pango.toml.in @@ -11,6 +11,8 @@ description = "Internationalized text layout and rendering" dependencies = [ "GObject-2.0", "HarfBuzz-0.0", "PangoCairo-1.0", "PangoFc-1.0", "PangoFT2-1.0", "PangoOT-1.0", "PangoXft-1.0" ] +related = [ "PangoCairo-1.0", "PangoFc-1.0", "PangoFT2-1.0", "PangoOT-1.0", + "PangoXft-1.0" ] devhelp = true search_index = true @@ -24,27 +26,27 @@ search_index = true description = "A text shaping library" docs_url = "https://harfbuzz.github.io/" - [dependencies."PangoCairo-1.0"] + [related."PangoCairo-1.0"] name = "PangoCairo" description = "Cairo support for Pango" docs_url = "../PangoCairo/" - [dependencies."PangoFc-1.0"] + [related."PangoFc-1.0"] name = "PangoFc" description = "Fontconfig support for Pango" docs_url = "../PangoFc/" - [dependencies."PangoFT2-1.0"] + [related."PangoFT2-1.0"] name = "PangoFT2" description = "Freetype support for Pango" docs_url = "../PangoFT2/" - [dependencies."PangoOT-1.0"] + [related."PangoOT-1.0"] name = "PangoOT" description = "OpenType support for Pango" docs_url = "../PangoOT/" - [dependencies."PangoXft-1.0"] + [related."PangoXft-1.0"] name = "PangoXft" description = "Xft support for Pango" docs_url = "../PangoXft/" diff --git a/docs/pangocairo.toml.in b/docs/pangocairo.toml.in index 1e45744b..a01e26f9 100644 --- a/docs/pangocairo.toml.in +++ b/docs/pangocairo.toml.in @@ -18,7 +18,7 @@ search_index = true docs_url = "../Pango/" [dependencies."cairo-1.0"] - name = "Cairo" + name = "cairo" description = "A vector graphics library" docs_url = "https://www.cairographics.org/manual/" diff --git a/docs/pangofc.toml.in b/docs/pangofc.toml.in index 2eafa239..dd6ae002 100644 --- a/docs/pangofc.toml.in +++ b/docs/pangofc.toml.in @@ -18,7 +18,7 @@ search_index = true docs_url = "../Pango/" [dependencies."fontconfig-2.0"] - name = "Fontconfig" + name = "fontconfig" description = "A font configuration and enumeration library" docs_url = "https://www.fontconfig.org" diff --git a/docs/pangoft2.toml.in b/docs/pangoft2.toml.in index 881d49fc..9079252a 100644 --- a/docs/pangoft2.toml.in +++ b/docs/pangoft2.toml.in @@ -18,7 +18,7 @@ search_index = true docs_url = "../Pango/" [dependencies."freetype2-2.0"] - name = "Freetype" + name = "freetype2" description = "A font loading and rendering library" docs_url = "https://www.freetype.org" diff --git a/docs/pangoxft.toml.in b/docs/pangoxft.toml.in index baf583e3..f6b8310f 100644 --- a/docs/pangoxft.toml.in +++ b/docs/pangoxft.toml.in @@ -18,7 +18,7 @@ search_index = true docs_url = "../Pango/" [dependencies."xft-2.0"] - name = "Xft" + name = "xft" description = "X11 client-side font rendering library" docs_url = "https://x.org" diff --git a/pango/break.c b/pango/break.c index 05ec97c9..229a199a 100644 --- a/pango/break.c +++ b/pango/break.c @@ -1482,7 +1482,10 @@ default_break (const char *text, !JAPANESE (wc)) || (!JAPANESE (last_word_letter) && JAPANESE (wc))) - attrs[i].is_word_end = TRUE; + { + attrs[i].is_word_start = TRUE; + attrs[i].is_word_end = TRUE; + } } } last_word_letter = wc; diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c index 0141c414..9d52dbcf 100644 --- a/pango/pangocairo-win32font.c +++ b/pango/pangocairo-win32font.c @@ -76,7 +76,6 @@ pango_cairo_win32_font_create_font_face (PangoCairoFont *font) PangoCairoWin32Font *cwfont = PANGO_CAIRO_WIN32_FONT (font); PangoWin32Font *win32font = &cwfont->font; void *dwrite_font_face = NULL; - gpointer dwrite_font = NULL; #ifdef HAVE_CAIRO_WIN32_DIRECTWRITE dwrite_font_face = pango_win32_font_get_dwrite_font_face (win32font); diff --git a/pango/pangowin32-dwrite-fontmap.cpp b/pango/pangowin32-dwrite-fontmap.cpp index a2c03675..2db0972a 100644 --- a/pango/pangowin32-dwrite-fontmap.cpp +++ b/pango/pangowin32-dwrite-fontmap.cpp @@ -103,6 +103,32 @@ _pango_win32_get_dwrite_font_face_from_dwrite_font (IDWriteFont *font) return NULL; } +static IDWriteFont * +get_dwrite_font_from_pango_win32_font (PangoWin32Font *font) +{ + PangoWin32DWriteItems *dwrite_items = pango_win32_get_direct_write_items (); + IDWriteFont *dwrite_font = NULL; + PangoWin32FontMap *fontmap = PANGO_WIN32_FONT_MAP (font->fontmap); + + dwrite_font = (IDWriteFont *) g_hash_table_lookup (fontmap->dwrite_fonts, + &font->logfontw); + + /* create the IDWriteFont from the logfont underlying the PangoWin32Font if needed */ + if (dwrite_font == NULL) + { + if (SUCCEEDED (dwrite_items->gdi_interop->CreateFontFromLOGFONT (&font->logfontw, + &dwrite_font)) && + dwrite_font != NULL) + { + g_hash_table_insert (fontmap->dwrite_fonts, + &font->logfontw, + dwrite_font); + } + } + + return dwrite_font; +} + void * pango_win32_font_get_dwrite_font_face (PangoWin32Font *font) { @@ -111,7 +137,7 @@ pango_win32_font_get_dwrite_font_face (PangoWin32Font *font) IDWriteFont *dwrite_font = NULL; IDWriteFontFace *face = NULL; - dwrite_font = (IDWriteFont *) g_hash_table_lookup (win32fontmap->dwrite_fonts, &win32font->logfontw); + dwrite_font = get_dwrite_font_from_pango_win32_font (font); if (dwrite_font != NULL) return (void *)_pango_win32_get_dwrite_font_face_from_dwrite_font (dwrite_font); @@ -424,7 +450,7 @@ pango_win32_font_description_from_logfontw_dwrite (const LOGFONTW *logfontw) PangoStretch stretch; PangoWin32DWriteItems *dwrite_items; - dwrite_items = pango_win32_init_direct_write (); + dwrite_items = pango_win32_get_direct_write_items (); if (dwrite_items == NULL) return NULL; @@ -452,30 +478,6 @@ pango_win32_font_description_from_logfontw_dwrite (const LOGFONTW *logfontw) return desc; } -static IDWriteFont * -get_dwrite_font_from_pango_win32_font (PangoWin32Font *font, - gboolean *is_cleanup_dwrite_font) -{ - PangoWin32DWriteItems *dwrite_items = pango_win32_get_direct_write_items (); - IDWriteFont *dwrite_font = NULL; - - dwrite_font = (IDWriteFont *) g_hash_table_lookup (PANGO_WIN32_FONT_MAP (font->fontmap)->dwrite_fonts, - &font->logfontw); - - /* create the IDWriteFont from the logfont underlying the PangoWin32Font if needed */ - if (dwrite_font == NULL) - { - if (SUCCEEDED (dwrite_items->gdi_interop->CreateFontFromLOGFONT (&font->logfontw, - &dwrite_font)) && - dwrite_font != NULL) - *is_cleanup_dwrite_font = TRUE; - else - dwrite_font = NULL; - } - - return dwrite_font; -} - /* macros to help parse the 'gasp' font table, referring to FreeType2 */ #define DWRITE_UCHAR_USHORT( p, i, s ) ( (unsigned short)( ((const unsigned char *)(p))[(i)] ) << (s) ) @@ -490,28 +492,11 @@ get_dwrite_font_from_pango_win32_font (PangoWin32Font *font, gboolean pango_win32_dwrite_font_check_is_hinted (PangoWin32Font *font) { - IDWriteFont *dwrite_font = NULL; IDWriteFontFace *dwrite_font_face = NULL; - gboolean failed = FALSE; gboolean result = FALSE; - gboolean dwrite_font_release = FALSE; dwrite_font_face = (IDWriteFontFace *)pango_win32_font_get_dwrite_font_face (font); - if (dwrite_font_face == NULL) - { - dwrite_font = get_dwrite_font_from_pango_win32_font (font, &dwrite_font_release); - - if (dwrite_font != NULL) - dwrite_font_face = _pango_win32_get_dwrite_font_face_from_dwrite_font (dwrite_font); - else - { - g_warning ("Failed to retrieve IDWriteFont from PangoWin32Font"); - - return FALSE; - } - } - if (dwrite_font_face != NULL) { UINT32 gasp_tag = DWRITE_MAKE_OPENTYPE_TAG ('g', 'a', 's', 'p'); @@ -553,9 +538,6 @@ pango_win32_dwrite_font_check_is_hinted (PangoWin32Font *font) dwrite_font_face->Release (); } - if (dwrite_font_release) - dwrite_font->Release (); - return result; } diff --git a/pango/pangowin32.c b/pango/pangowin32.c index 5a26ee98..7b6325a5 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -133,7 +133,6 @@ HDC _pango_win32_get_display_dc (void) { HDC hdc = g_private_get (&display_dc_key); - PangoWin32DWriteItems *items; if (hdc == NULL) { @@ -154,12 +153,8 @@ _pango_win32_get_display_dc (void) #endif } - items = g_private_get (&dwrite_items); - if (items == NULL) - { - items = pango_win32_init_direct_write (); - g_private_set (&dwrite_items, items); - } + /* ensure DirectWrite is initialized */ + pango_win32_get_direct_write_items (); return hdc; } @@ -167,7 +162,15 @@ _pango_win32_get_display_dc (void) PangoWin32DWriteItems * pango_win32_get_direct_write_items (void) { - return g_private_get (&dwrite_items); + PangoWin32DWriteItems *items = g_private_get (&dwrite_items); + + if (items == NULL) + { + items = pango_win32_init_direct_write (); + g_private_set (&dwrite_items, items); + } + + return items; } /** |