Akihiro Sagawa : gdi32: Add a helper to get the default character index.
Alexandre Julliard
julliard at winehq.org
Wed May 22 13:46:59 CDT 2013
Module: wine
Branch: master
Commit: f6ea5c8a0f94c03d88376e69db31ead707ae4028
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f6ea5c8a0f94c03d88376e69db31ead707ae4028
Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date: Wed May 22 19:46:28 2013 +0900
gdi32: Add a helper to get the default character index.
---
dlls/gdi32/freetype.c | 31 ++++++++++++++++++++-----------
1 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index bc43772..50bd52b 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -5817,6 +5817,25 @@ static FT_UInt get_glyph_index(const GdiFont *font, UINT glyph)
return glyphId;
}
+static FT_UInt get_default_char_index(GdiFont *font)
+{
+ FT_UInt default_char;
+
+ if (FT_IS_SFNT(font->ft_face))
+ {
+ TT_OS2 *pOS2 = pFT_Get_Sfnt_Table(font->ft_face, ft_sfnt_os2);
+ default_char = (pOS2->usDefaultChar ? get_glyph_index(font, pOS2->usDefaultChar) : 0);
+ }
+ else
+ {
+ TEXTMETRICW textm;
+ get_text_metrics(font, &textm);
+ default_char = textm.tmDefaultChar;
+ }
+
+ return default_char;
+}
+
/*************************************************************
* freetype_GetGlyphIndices
*/
@@ -5849,17 +5868,7 @@ static DWORD freetype_GetGlyphIndices( PHYSDEV dev, LPCWSTR lpstr, INT count, LP
{
if (!got_default)
{
- if (FT_IS_SFNT(physdev->font->ft_face))
- {
- TT_OS2 *pOS2 = pFT_Get_Sfnt_Table(physdev->font->ft_face, ft_sfnt_os2);
- default_char = (pOS2->usDefaultChar ? get_glyph_index(physdev->font, pOS2->usDefaultChar) : 0);
- }
- else
- {
- TEXTMETRICW textm;
- get_text_metrics(physdev->font, &textm);
- default_char = textm.tmDefaultChar;
- }
+ default_char = get_default_char_index(physdev->font);
got_default = TRUE;
}
pgi[i] = default_char;
More information about the wine-cvs
mailing list