ReactOS 0.4.17-dev-218-g5635d24
font.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winnls.h"
#include "winreg.h"
#include "wine/debug.h"
#include "objbase.h"
#include "gdiplus.h"
#include "gdiplus_private.h"
#include "pshpack2.h"
#include "poppack.h"
Include dependency graph for font.c:

Go to the source code of this file.

Classes

struct  TT_OS2_V2
 
struct  TT_HHEA
 
struct  font_metrics
 
struct  tt_header
 
struct  tt_table_directory
 
struct  tt_name_table
 
struct  tt_name_record
 
struct  add_font_param
 

Macros

#define GET_BE_WORD(x)   MAKEWORD(HIBYTE(x), LOBYTE(x))
 
#define GET_BE_DWORD(x)   MAKELONG(GET_BE_WORD(HIWORD(x)), GET_BE_WORD(LOWORD(x)))
 
#define MS_MAKE_TAG(ch0, ch1, ch2, ch3)
 
#define MS_OS2_TAG   MS_MAKE_TAG('O','S','/','2')
 
#define MS_HHEA_TAG   MS_MAKE_TAG('h','h','e','a')
 
#define TT_PLATFORM_APPLE_UNICODE   0
 
#define TT_PLATFORM_MACINTOSH   1
 
#define TT_PLATFORM_MICROSOFT   3
 
#define TT_APPLE_ID_DEFAULT   0
 
#define TT_APPLE_ID_ISO_10646   2
 
#define TT_APPLE_ID_UNICODE_2_0   3
 
#define TT_MS_ID_SYMBOL_CS   0
 
#define TT_MS_ID_UNICODE_CS   1
 
#define TT_MAC_ID_SIMPLIFIED_CHINESE   25
 
#define NAME_ID_FULL_FONT_NAME   4
 
#define TT_HEADER_VERSION_1   0x00010000
 
#define TT_HEADER_VERSION_CFF   0x4f54544f
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (gdiplus)
 
GpStatus WINGDIPAPI GdipCreateFont (GDIPCONST GpFontFamily *fontFamily, REAL emSize, INT style, Unit unit, GpFont **font)
 
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW (HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font)
 
GpStatus WINGDIPAPI GdipCreateFontFromLogfontA (HDC hdc, GDIPCONST LOGFONTA *lfa, GpFont **font)
 
GpStatus WINGDIPAPI GdipDeleteFont (GpFont *font)
 
GpStatus WINGDIPAPI GdipCreateFontFromDC (HDC hdc, GpFont **font)
 
GpStatus WINGDIPAPI GdipGetFamily (GpFont *font, GpFontFamily **family)
 
static REAL get_font_size (const GpFont *font)
 
GpStatus WINGDIPAPI GdipGetFontSize (GpFont *font, REAL *size)
 
static INT get_font_style (const GpFont *font)
 
GpStatus WINGDIPAPI GdipGetFontStyle (GpFont *font, INT *style)
 
GpStatus WINGDIPAPI GdipGetFontUnit (GpFont *font, Unit *unit)
 
GpStatus WINGDIPAPI GdipGetLogFontA (GpFont *font, GpGraphics *graphics, LOGFONTA *lfa)
 
GpStatus WINGDIPAPI GdipGetLogFontW (GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
 
GpStatus WINGDIPAPI GdipCloneFont (GpFont *font, GpFont **cloneFont)
 
GpStatus WINGDIPAPI GdipGetFontHeight (GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height)
 
GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI (GDIPCONST GpFont *font, REAL dpi, REAL *height)
 
static INT CALLBACK is_font_installed_proc (const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
 
static BOOL get_font_metrics (HDC hdc, struct font_metrics *fm)
 
GpStatus WINGDIPAPI GdipCreateFontFamilyFromName (GDIPCONST WCHAR *name, GpFontCollection *collection, GpFontFamily **family)
 
GpStatus WINGDIPAPI GdipCloneFontFamily (GpFontFamily *family, GpFontFamily **clone)
 
GpStatus WINGDIPAPI GdipGetFamilyName (GDIPCONST GpFontFamily *family, WCHAR *name, LANGID language)
 
GpStatus WINGDIPAPI GdipDeleteFontFamily (GpFontFamily *FontFamily)
 
GpStatus WINGDIPAPI GdipGetCellAscent (GDIPCONST GpFontFamily *family, INT style, UINT16 *CellAscent)
 
GpStatus WINGDIPAPI GdipGetCellDescent (GDIPCONST GpFontFamily *family, INT style, UINT16 *CellDescent)
 
GpStatus WINGDIPAPI GdipGetEmHeight (GDIPCONST GpFontFamily *family, INT style, UINT16 *EmHeight)
 
GpStatus WINGDIPAPI GdipGetLineSpacing (GDIPCONST GpFontFamily *family, INT style, UINT16 *LineSpacing)
 
static INT CALLBACK font_has_style_proc (const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
 
GpStatus WINGDIPAPI GdipIsStyleAvailable (GDIPCONST GpFontFamily *family, INT style, BOOL *IsStyleAvailable)
 
GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace (GpFontFamily **nativeFamily)
 
GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif (GpFontFamily **nativeFamily)
 
GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif (GpFontFamily **nativeFamily)
 
GpStatus WINGDIPAPI GdipNewPrivateFontCollection (GpFontCollection **fontCollection)
 
GpStatus WINGDIPAPI GdipDeletePrivateFontCollection (GpFontCollection **fontCollection)
 
GpStatus WINGDIPAPI GdipPrivateAddFontFile (GpFontCollection *collection, GDIPCONST WCHAR *name)
 
static WORD get_mac_code_page (const tt_name_record *name)
 
static int match_name_table_language (const tt_name_record *name, LANGID lang)
 
static WCHARcopy_name_table_string (const tt_name_record *name, const BYTE *data)
 
static WCHARload_ttf_name_id (const BYTE *mem, DWORD_PTR size, DWORD id)
 
static INT CALLBACK add_font_proc (const LOGFONTW *lfw, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
 
GpStatus WINGDIPAPI GdipPrivateAddMemoryFont (GpFontCollection *fontCollection, GDIPCONST void *memory, INT length)
 
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount (GpFontCollection *fontCollection, INT *numFound)
 
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList (GpFontCollection *fontCollection, INT numSought, GpFontFamily *gpfamilies[], INT *numFound)
 
void free_installed_fonts (void)
 
GpStatus WINGDIPAPI GdipNewInstalledFontCollection (GpFontCollection **fontCollection)
 

Variables

static GpFontCollection installedFontCollection = {0}
 
static CRITICAL_SECTION font_cs = { &critsect_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG critsect_debug
 
static const LANGID mac_langid_table []
 

Macro Definition Documentation

◆ GET_BE_DWORD

#define GET_BE_DWORD (   x)    MAKELONG(GET_BE_WORD(HIWORD(x)), GET_BE_WORD(LOWORD(x)))

Definition at line 109 of file font.c.

◆ GET_BE_WORD

#define GET_BE_WORD (   x)    MAKEWORD(HIBYTE(x), LOBYTE(x))

Definition at line 108 of file font.c.

◆ MS_HHEA_TAG

#define MS_HHEA_TAG   MS_MAKE_TAG('h','h','e','a')

Definition at line 116 of file font.c.

◆ MS_MAKE_TAG

#define MS_MAKE_TAG (   ch0,
  ch1,
  ch2,
  ch3 
)
Value:
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24))
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DWORD
Definition: nt_native.h:44
unsigned char BYTE
Definition: xxhash.c:193

Definition at line 112 of file font.c.

◆ MS_OS2_TAG

#define MS_OS2_TAG   MS_MAKE_TAG('O','S','/','2')

Definition at line 115 of file font.c.

◆ NAME_ID_FULL_FONT_NAME

#define NAME_ID_FULL_FONT_NAME   4

Definition at line 1143 of file font.c.

◆ TT_APPLE_ID_DEFAULT

#define TT_APPLE_ID_DEFAULT   0

Definition at line 1134 of file font.c.

◆ TT_APPLE_ID_ISO_10646

#define TT_APPLE_ID_ISO_10646   2

Definition at line 1135 of file font.c.

◆ TT_APPLE_ID_UNICODE_2_0

#define TT_APPLE_ID_UNICODE_2_0   3

Definition at line 1136 of file font.c.

◆ TT_HEADER_VERSION_1

#define TT_HEADER_VERSION_1   0x00010000

Definition at line 1153 of file font.c.

◆ TT_HEADER_VERSION_CFF

#define TT_HEADER_VERSION_CFF   0x4f54544f

Definition at line 1154 of file font.c.

◆ TT_MAC_ID_SIMPLIFIED_CHINESE

#define TT_MAC_ID_SIMPLIFIED_CHINESE   25

Definition at line 1141 of file font.c.

◆ TT_MS_ID_SYMBOL_CS

#define TT_MS_ID_SYMBOL_CS   0

Definition at line 1138 of file font.c.

◆ TT_MS_ID_UNICODE_CS

#define TT_MS_ID_UNICODE_CS   1

Definition at line 1139 of file font.c.

◆ TT_PLATFORM_APPLE_UNICODE

#define TT_PLATFORM_APPLE_UNICODE   0

Definition at line 1130 of file font.c.

◆ TT_PLATFORM_MACINTOSH

#define TT_PLATFORM_MACINTOSH   1

Definition at line 1131 of file font.c.

◆ TT_PLATFORM_MICROSOFT

#define TT_PLATFORM_MICROSOFT   3

Definition at line 1132 of file font.c.

Function Documentation

◆ add_font_proc()

static INT CALLBACK add_font_proc ( const LOGFONTW lfw,
const TEXTMETRICW ntm,
DWORD  type,
LPARAM  lParam 
)
static

Definition at line 1579 of file font.c.

1581{
1582 struct add_font_param *param = (struct add_font_param *)lParam;
1583 GpFontCollection *fonts = param->collection;
1584 GpFontFamily *family;
1585 HFONT hfont, old_hfont;
1586 struct font_metrics fm;
1587 int i;
1588
1589 param->stat = Ok;
1590
1591 if (type == RASTER_FONTTYPE)
1592 return 1;
1593
1594 /* skip rotated fonts */
1595 if (lfw->lfFaceName[0] == '@')
1596 return 1;
1597
1598 if (fonts->count && wcsicmp(lfw->lfFaceName, fonts->FontFamilies[fonts->count-1]->FamilyName) == 0)
1599 return 1;
1600
1601 if (fonts->allocated == fonts->count)
1602 {
1603 INT new_alloc_count = fonts->allocated+50;
1604 GpFontFamily** new_family_list = malloc(new_alloc_count * sizeof(void*));
1605
1606 if (!new_family_list)
1607 {
1608 param->stat = OutOfMemory;
1609 return 0;
1610 }
1611
1612 memcpy(new_family_list, fonts->FontFamilies, fonts->count*sizeof(void*));
1613 free(fonts->FontFamilies);
1614 fonts->FontFamilies = new_family_list;
1615 fonts->allocated = new_alloc_count;
1616 }
1617
1618 family = malloc(sizeof(*family));
1619 if (!family)
1620 {
1621 if (param->is_system)
1622 return 1;
1623
1624 param->stat = OutOfMemory;
1625 return 0;
1626 }
1627
1628 /* skip duplicates */
1629 for (i=0; i<fonts->count; i++)
1630 {
1631 if (wcsicmp(lfw->lfFaceName, fonts->FontFamilies[i]->FamilyName) == 0)
1632 {
1633 free(family);
1634 return 1;
1635 }
1636 }
1637
1639 old_hfont = SelectObject(param->hdc, hfont);
1640
1641 if (!get_font_metrics(param->hdc, &fm))
1642 {
1643 SelectObject(param->hdc, old_hfont);
1645
1646 free(family);
1647 param->stat = OutOfMemory;
1648 return 0;
1649 }
1650
1651 SelectObject(param->hdc, old_hfont);
1653
1654 family->em_height = fm.em_height;
1655 family->ascent = fm.ascent;
1656 family->descent = fm.descent;
1657 family->line_spacing = fm.line_spacing;
1658 family->dpi = fm.dpi;
1659 family->installed = param->is_system;
1660 family->ref = 1;
1661
1662 lstrcpyW(family->FamilyName, lfw->lfFaceName);
1663
1664 fonts->FontFamilies[fonts->count++] = family;
1665
1666 return 1;
1667}
static HFONT hfont
LPARAM lParam
Definition: combotst.c:139
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define lstrcpyW
Definition: compat.h:749
#define wcsicmp
Definition: compat.h:15
static BOOL get_font_metrics(HDC hdc, struct font_metrics *fm)
Definition: font.c:632
pKey DeleteObject()
@ Ok
Definition: gdiplustypes.h:25
@ OutOfMemory
Definition: gdiplustypes.h:28
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLfloat param
Definition: glext.h:5796
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GpFontFamily ** FontFamilies
WCHAR FamilyName[LF_FACESIZE]
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
int32_t INT
Definition: typedefs.h:58
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define RASTER_FONTTYPE
Definition: wingdi.h:1107
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)

Referenced by GdipNewInstalledFontCollection(), and GdipPrivateAddMemoryFont().

◆ copy_name_table_string()

static WCHAR * copy_name_table_string ( const tt_name_record name,
const BYTE data 
)
static

Definition at line 1357 of file font.c.

1358{
1359 WORD name_len = GET_BE_WORD(name->length);
1360 WORD codepage;
1361 WCHAR *ret;
1362 int len;
1363
1364 switch (GET_BE_WORD(name->platform_id))
1365 {
1368 ret = malloc((name_len / 2 + 1) * sizeof(WCHAR));
1369 for (len = 0; len < name_len / 2; len++)
1370 ret[len] = (data[len * 2] << 8) | data[len * 2 + 1];
1371 ret[len] = 0;
1372 return ret;
1375 len = MultiByteToWideChar( codepage, 0, (char *)data, name_len, NULL, 0 ) + 1;
1376 if (!len)
1377 return NULL;
1378 ret = malloc(len * sizeof(WCHAR));
1379 len = MultiByteToWideChar( codepage, 0, (char *)data, name_len, ret, len - 1 );
1380 ret[len] = 0;
1381 return ret;
1382 }
1383 return NULL;
1384}
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
static WORD get_mac_code_page(const tt_name_record *name)
Definition: font.c:1304
#define TT_PLATFORM_MICROSOFT
Definition: font.c:1132
#define TT_PLATFORM_MACINTOSH
Definition: font.c:1131
#define TT_PLATFORM_APPLE_UNICODE
Definition: font.c:1130
#define GET_BE_WORD(x)
Definition: font.c:108
return ret
Definition: mutex.c:146
unsigned short WORD
Definition: ntddk_ex.h:93
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum GLsizei len
Definition: glext.h:6722
short WCHAR
Definition: pedump.c:58
Definition: name.c:39
int codepage
Definition: win_iconv.c:156

Referenced by load_ttf_name_id().

◆ font_has_style_proc()

static INT CALLBACK font_has_style_proc ( const LOGFONTW elf,
const TEXTMETRICW ntm,
DWORD  type,
LPARAM  lParam 
)
static

Definition at line 915 of file font.c.

917{
918 INT fontstyle = FontStyleRegular;
919
920 if (!ntm) return 1;
921
922 if (ntm->tmWeight >= FW_BOLD) fontstyle |= FontStyleBold;
923 if (ntm->tmItalic) fontstyle |= FontStyleItalic;
924 if (ntm->tmUnderlined) fontstyle |= FontStyleUnderline;
925 if (ntm->tmStruckOut) fontstyle |= FontStyleStrikeout;
926
927 return (INT)lParam != fontstyle;
928}
@ FontStyleUnderline
Definition: gdiplusenums.h:305
@ FontStyleBold
Definition: gdiplusenums.h:302
@ FontStyleStrikeout
Definition: gdiplusenums.h:306
@ FontStyleRegular
Definition: gdiplusenums.h:301
@ FontStyleItalic
Definition: gdiplusenums.h:303
BYTE tmItalic
Definition: wingdi.h:2844
BYTE tmStruckOut
Definition: wingdi.h:2846
BYTE tmUnderlined
Definition: wingdi.h:2845
LONG tmWeight
Definition: wingdi.h:2836
#define FW_BOLD
Definition: wingdi.h:378

Referenced by GdipIsStyleAvailable().

◆ free_installed_fonts()

void free_installed_fonts ( void  )

Definition at line 1567 of file font.c.

1568{
1569 INT i;
1570
1571 for (i = 0; i < installedFontCollection.count; i++)
1574
1577}
static GpFontCollection installedFontCollection
Definition: font.c:118

Referenced by DllMain(), and GdipNewInstalledFontCollection().

◆ GdipCloneFont()

GpStatus WINGDIPAPI GdipCloneFont ( GpFont font,
GpFont **  cloneFont 
)

Definition at line 503 of file font.c.

504{
505 TRACE("(%p, %p)\n", font, cloneFont);
506
507 if(!font || !cloneFont)
508 return InvalidParameter;
509
510 *cloneFont = calloc(1, sizeof(GpFont));
511 if(!*cloneFont) return OutOfMemory;
512
513 **cloneFont = *font;
514 return Ok;
515}
@ InvalidParameter
Definition: gdiplustypes.h:27
Definition: mk_font.cpp:20
#define calloc
Definition: rosglue.h:14
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by test_CloneFont(), and test_drawdriverstring().

◆ GdipCloneFontFamily()

GpStatus WINGDIPAPI GdipCloneFontFamily ( GpFontFamily family,
GpFontFamily **  clone 
)

Definition at line 754 of file font.c.

755{
756 if (!family || !clone)
757 return InvalidParameter;
758
759 TRACE("%p (%s), %p\n", family, debugstr_w(family->FamilyName), clone);
760
761 *clone = family;
762
763 if (!family->installed)
764 InterlockedIncrement(&family->ref);
765
766 return Ok;
767}
#define InterlockedIncrement
Definition: armddk.h:53
#define debugstr_w
Definition: kernel32.h:32

Referenced by GdipCreateFont(), GdipCreateFontFamilyFromName(), GdipGetFamily(), test_fontfamily(), and test_long_name().

◆ GdipCreateFont()

GpStatus WINGDIPAPI GdipCreateFont ( GDIPCONST GpFontFamily fontFamily,
REAL  emSize,
INT  style,
Unit  unit,
GpFont **  font 
)

Definition at line 150 of file font.c.

152{
153 HFONT hfont;
155 LOGFONTW lfw;
156 HDC hdc;
158 int ret;
159
160 if (!fontFamily || !font || emSize < 0.0)
161 return InvalidParameter;
162
163 TRACE("%p (%s), %f, %d, %d, %p\n", fontFamily,
164 debugstr_w(fontFamily->FamilyName), emSize, style, unit, font);
165
166 memset(&lfw, 0, sizeof(lfw));
167
168 stat = GdipGetFamilyName(fontFamily, lfw.lfFaceName, LANG_NEUTRAL);
169 if (stat != Ok) return stat;
170
171 lfw.lfHeight = -units_to_pixels(emSize, unit, fontFamily->dpi, FALSE);
177
181 otm.otmSize = sizeof(otm);
183 DeleteDC(hdc);
185
186 if (!ret) return NotTrueTypeFont;
187
188 *font = calloc(1, sizeof(GpFont));
189 if (!*font) return OutOfMemory;
190
191 (*font)->unit = unit;
192 (*font)->emSize = emSize;
193 (*font)->otm = otm;
194 GdipCloneFontFamily((GpFontFamily*)fontFamily, &(*font)->family);
195
196 TRACE("<-- %p\n", *font);
197
198 return Ok;
199}
#define stat
Definition: acwin.h:100
Arabic default style
Definition: afstyles.h:94
#define FALSE
Definition: types.h:117
GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily *family, GpFontFamily **clone)
Definition: font.c:754
GpStatus WINGDIPAPI GdipGetFamilyName(GDIPCONST GpFontFamily *family, WCHAR *name, LANGID language)
Definition: font.c:786
REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi, BOOL printer_display)
Definition: gdiplus.c:329
Status
Definition: gdiplustypes.h:24
@ NotTrueTypeFont
Definition: gdiplustypes.h:41
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
png_const_structrp png_const_inforp int * unit
Definition: png.h:2392
#define LANG_NEUTRAL
Definition: nls.h:22
#define memset(x, y, z)
Definition: compat.h:39
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
BYTE lfUnderline
Definition: dimm.idl:65
BYTE lfCharSet
Definition: dimm.idl:67
Definition: stat.h:66
#define FW_REGULAR
Definition: wingdi.h:374
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define DEFAULT_CHARSET
Definition: wingdi.h:384
UINT WINAPI GetOutlineTextMetricsW(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICW potm)
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by check_family(), GdipAddPathString(), METAFILE_PlaybackObject(), test_CloneFont(), test_createfont(), test_createfont_charset(), test_font_height_scaling(), test_font_metrics(), test_font_substitution(), test_GdipMeasureString(), test_heightgivendpi(), test_long_name(), test_measure_string(), test_measured_extra_space(), test_string_functions(), and test_unknownfontdecode().

◆ GdipCreateFontFamilyFromName()

GpStatus WINGDIPAPI GdipCreateFontFamilyFromName ( GDIPCONST WCHAR name,
GpFontCollection collection,
GpFontFamily **  family 
)

Definition at line 701 of file font.c.

704{
705 HDC hdc;
706 LOGFONTW lf;
708 int i;
709
710 TRACE("%s, %p %p\n", debugstr_w(name), collection, family);
711
712 if (!name || !family)
713 return InvalidParameter;
714
715 if (!collection)
716 {
718 if (status != Ok) return status;
719 }
720
722
724
726 {
727 for (i = 0; i < collection->count; i++)
728 {
729 if (!wcsicmp(lf.lfFaceName, collection->FontFamilies[i]->FamilyName))
730 {
731 status = GdipCloneFontFamily(collection->FontFamilies[i], family);
732 TRACE("<-- %p\n", *family);
733 break;
734 }
735 }
736 }
737
738 DeleteDC(hdc);
739 return status;
740}
GpStatus WINGDIPAPI GdipNewInstalledFontCollection(GpFontCollection **fontCollection)
Definition: font.c:1669
static INT CALLBACK is_font_installed_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
Definition: font.c:610
@ FontFamilyNotFound
Definition: gdiplustypes.h:39
LONG_PTR LPARAM
Definition: minwindef.h:175
static ICollection collection
Definition: typelib.c:184
Definition: ps.c:97
int WINAPI EnumFontFamiliesW(_In_ HDC, _In_opt_ LPCWSTR, _In_ FONTENUMPROCW, _In_ LPARAM)

Referenced by GdipCreateFontFromLogfontW(), GdipGetGenericFontFamilyMonospace(), GdipGetGenericFontFamilySansSerif(), GdipGetGenericFontFamilySerif(), METAFILE_PlaybackObject(), test_CloneFont(), test_createfont(), test_createfont_charset(), test_font_height_scaling(), test_font_metrics(), test_font_substitution(), test_fontfamily(), test_fontfamily_properties(), test_GdipMeasureString(), test_heightgivendpi(), test_measure_string(), test_measured_extra_space(), and test_string_functions().

◆ GdipCreateFontFromDC()

GpStatus WINGDIPAPI GdipCreateFontFromDC ( HDC  hdc,
GpFont **  font 
)

Definition at line 288 of file font.c.

289{
290 HFONT hfont;
291 LOGFONTW lfw;
292
293 TRACE("(%p, %p)\n", hdc, font);
294
295 if(!font)
296 return InvalidParameter;
297
299 if(!hfont)
300 return GenericError;
301
302 if(!GetObjectW(hfont, sizeof(LOGFONTW), &lfw))
303 return GenericError;
304
305 return GdipCreateFontFromLogfontW(hdc, &lfw, font);
306}
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font)
Definition: font.c:204
@ GenericError
Definition: gdiplustypes.h:26
#define OBJ_FONT
Definition: objidl.idl:1019
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:428

Referenced by generate_font_link_info().

◆ GdipCreateFontFromLogfontA()

GpStatus WINGDIPAPI GdipCreateFontFromLogfontA ( HDC  hdc,
GDIPCONST LOGFONTA lfa,
GpFont **  font 
)

Definition at line 251 of file font.c.

253{
254 LOGFONTW lfw;
255
256 TRACE("(%p, %p, %p)\n", hdc, lfa, font);
257
258 if(!lfa || !font)
259 return InvalidParameter;
260
261 memcpy(&lfw, lfa, FIELD_OFFSET(LOGFONTA,lfFaceName) );
262
263 if(!MultiByteToWideChar(CP_ACP, 0, lfa->lfFaceName, -1, lfw.lfFaceName, LF_FACESIZE))
264 return GenericError;
265
266 return GdipCreateFontFromLogfontW(hdc, &lfw, font);
267}
#define LF_FACESIZE
Definition: dimm.idl:39
#define CP_ACP
Definition: compat.h:109
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by test_drawdriverstring(), test_font_substitution(), test_font_transform(), test_GdipDrawString(), and test_logfont().

◆ GdipCreateFontFromLogfontW()

GpStatus WINGDIPAPI GdipCreateFontFromLogfontW ( HDC  hdc,
GDIPCONST LOGFONTW logfont,
GpFont **  font 
)

Definition at line 204 of file font.c.

206{
207 HFONT hfont, oldfont;
209 WCHAR facename[LF_FACESIZE];
211 int ret;
212
213 TRACE("(%p, %p, %p)\n", hdc, logfont, font);
214
215 if (!hdc || !logfont || !font)
216 return InvalidParameter;
217
218 hfont = CreateFontIndirectW(logfont);
219 oldfont = SelectObject(hdc, hfont);
220 otm.otmSize = sizeof(otm);
222 GetTextFaceW(hdc, LF_FACESIZE, facename);
223 SelectObject(hdc, oldfont);
225
226 if (!ret) return NotTrueTypeFont;
227
228 *font = calloc(1, sizeof(GpFont));
229 if (!*font) return OutOfMemory;
230
231 (*font)->unit = UnitWorld;
232 (*font)->emSize = otm.otmTextMetrics.tmHeight - otm.otmTextMetrics.tmInternalLeading;
233 (*font)->otm = otm;
234
235 stat = GdipCreateFontFamilyFromName(facename, NULL, &(*font)->family);
236 if (stat != Ok)
237 {
238 free(*font);
239 *font = NULL;
240 return NotTrueTypeFont;
241 }
242
243 TRACE("<-- %p\n", *font);
244
245 return Ok;
246}
GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, GpFontCollection *collection, GpFontFamily **family)
Definition: font.c:701
@ UnitWorld
Definition: gdiplusenums.h:27
TEXTMETRICW otmTextMetrics
Definition: wingdi.h:2960
LONG tmInternalLeading
Definition: wingdi.h:2832
LONG tmHeight
Definition: wingdi.h:2829
int WINAPI GetTextFaceW(_In_ HDC hdc, _In_ int c, _Out_writes_to_opt_(c, return) LPWSTR lpName)

Referenced by GdipCreateFontFromDC(), GdipCreateFontFromLogfontA(), and test_font_metrics().

◆ GdipDeleteFont()

◆ GdipDeleteFontFamily()

◆ GdipDeletePrivateFontCollection()

GpStatus WINGDIPAPI GdipDeletePrivateFontCollection ( GpFontCollection **  fontCollection)

Definition at line 1076 of file font.c.

1077{
1078 INT i;
1079
1080 TRACE("%p\n", fontCollection);
1081
1082 if (!fontCollection)
1083 return InvalidParameter;
1084
1085 for (i = 0; i < (*fontCollection)->count; i++) GdipDeleteFontFamily((*fontCollection)->FontFamilies[i]);
1086 free((*fontCollection)->FontFamilies);
1087 free(*fontCollection);
1088
1089 return Ok;
1090}

Referenced by test_GdipPrivateAddMemoryFont(), test_long_name(), and test_unknownfontdecode().

◆ GdipGetCellAscent()

GpStatus WINGDIPAPI GdipGetCellAscent ( GDIPCONST GpFontFamily family,
INT  style,
UINT16 CellAscent 
)

Definition at line 834 of file font.c.

836{
837 if (!(family && CellAscent)) return InvalidParameter;
838
839 *CellAscent = family->ascent;
840 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *CellAscent);
841
842 return Ok;
843}

Referenced by gdip_get_font_metrics(), and test_fontfamily_properties().

◆ GdipGetCellDescent()

GpStatus WINGDIPAPI GdipGetCellDescent ( GDIPCONST GpFontFamily family,
INT  style,
UINT16 CellDescent 
)

Definition at line 845 of file font.c.

847{
848 TRACE("(%p, %d, %p)\n", family, style, CellDescent);
849
850 if (!(family && CellDescent)) return InvalidParameter;
851
852 *CellDescent = family->descent;
853 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *CellDescent);
854
855 return Ok;
856}

Referenced by gdip_get_font_metrics(), and test_fontfamily_properties().

◆ GdipGetEmHeight()

GpStatus WINGDIPAPI GdipGetEmHeight ( GDIPCONST GpFontFamily family,
INT  style,
UINT16 EmHeight 
)

Definition at line 872 of file font.c.

873{
874 if (!(family && EmHeight)) return InvalidParameter;
875
876 TRACE("%p (%s), %d, %p\n", family, debugstr_w(family->FamilyName), style, EmHeight);
877
878 *EmHeight = family->em_height;
879 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *EmHeight);
880
881 return Ok;
882}

Referenced by gdip_get_font_metrics(), GdipAddPathString(), GdipGetFontHeightGivenDPI(), test_fontfamily_properties(), and test_logfont().

◆ GdipGetFamily()

GpStatus WINGDIPAPI GdipGetFamily ( GpFont font,
GpFontFamily **  family 
)

Definition at line 321 of file font.c.

322{
323 TRACE("%p %p\n", font, family);
324
325 if (!(font && family))
326 return InvalidParameter;
327
328 return GdipCloneFontFamily(font->family, family);
329}

Referenced by gdip_get_font_metrics(), test_CloneFont(), test_createfont(), and test_logfont().

◆ GdipGetFamilyName()

GpStatus WINGDIPAPI GdipGetFamilyName ( GDIPCONST GpFontFamily family,
WCHAR name,
LANGID  language 
)

Definition at line 786 of file font.c.

788{
789 static int lang_fixme;
790
791 TRACE("%p, %p, %d\n", family, name, language);
792
793 if (family == NULL)
794 return InvalidParameter;
795
796 if (name == NULL)
797 return Ok;
798
799 if (language != LANG_NEUTRAL && !lang_fixme++)
800 FIXME("No support for handling of multiple languages!\n");
801
802 lstrcpynW (name, family->FamilyName, LF_FACESIZE);
803
804 return Ok;
805}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define lstrcpynW
Definition: compat.h:738

Referenced by check_family(), GdipCreateFont(), test_createfont(), test_fontfamily(), and test_long_name().

◆ GdipGetFontCollectionFamilyCount()

GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount ( GpFontCollection fontCollection,
INT numFound 
)

Definition at line 1528 of file font.c.

1530{
1531 TRACE("%p, %p\n", fontCollection, numFound);
1532
1533 if (!(fontCollection && numFound))
1534 return InvalidParameter;
1535
1536 *numFound = fontCollection->count;
1537 return Ok;
1538}

Referenced by is_family_in_collection(), test_GdipGetFontCollectionFamilyCount(), test_GdipGetFontCollectionFamilyList(), test_GdipPrivateAddMemoryFont(), test_long_name(), and test_unknownfontdecode().

◆ GdipGetFontCollectionFamilyList()

GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList ( GpFontCollection fontCollection,
INT  numSought,
GpFontFamily gpfamilies[],
INT numFound 
)

Definition at line 1543 of file font.c.

1546{
1547 INT i;
1548
1549 TRACE("%p, %d, %p, %p\n", fontCollection, numSought, gpfamilies, numFound);
1550
1551 if (!(fontCollection && gpfamilies && numFound))
1552 return InvalidParameter;
1553
1554 memset(gpfamilies, 0, sizeof(*gpfamilies) * numSought);
1555
1556 for (i = 0; i < numSought && i < fontCollection->count; i++)
1557 {
1558 /* caller is responsible for cloning these if it keeps references */
1559 gpfamilies[i] = fontCollection->FontFamilies[i];
1560 }
1561
1562 *numFound = i;
1563
1564 return Ok;
1565}

Referenced by is_family_in_collection(), test_GdipGetFontCollectionFamilyList(), test_long_name(), and test_unknownfontdecode().

◆ GdipGetFontHeight()

GpStatus WINGDIPAPI GdipGetFontHeight ( GDIPCONST GpFont font,
GDIPCONST GpGraphics graphics,
REAL height 
)

Definition at line 530 of file font.c.

532{
533 REAL dpi;
535 REAL font_height;
536
537 TRACE("%p %p %p\n", font, graphics, height);
538
539 if (!font || !height) return InvalidParameter;
540
541 stat = GdipGetFontHeightGivenDPI(font, font->family->dpi, &font_height);
542 if (stat != Ok) return stat;
543
544 if (!graphics)
545 {
546 *height = font_height;
547 TRACE("%s,%ld => %f\n",
548 debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *height);
549 return Ok;
550 }
551
552 stat = GdipGetDpiY((GpGraphics *)graphics, &dpi);
553 if (stat != Ok) return stat;
554
555 *height = pixels_to_units(font_height, graphics->unit, dpi, graphics->printer_display);
556
557 TRACE("%s,%ld(unit %d) => %f\n",
558 debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, graphics->unit, *height);
559 return Ok;
560}
float REAL
Definition: types.h:41
GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height)
Definition: font.c:577
GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL *dpi)
Definition: graphics.c:7002
REAL pixels_to_units(REAL pixels, GpUnit unit, REAL dpi, BOOL printer_display)
Definition: gdiplus.c:356
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define dpi
Definition: sysparams.c:23

Referenced by gdip_get_font_metrics(), test_font_height_scaling(), test_font_transform(), and test_logfont().

◆ GdipGetFontHeightGivenDPI()

GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI ( GDIPCONST GpFont font,
REAL  dpi,
REAL height 
)

Definition at line 577 of file font.c.

578{
580 INT style;
581 UINT16 line_spacing, em_height;
582 REAL font_size;
583
584 if (!font || !height) return InvalidParameter;
585
586 TRACE("%p (%s), %f, %p\n", font,
587 debugstr_w(font->family->FamilyName), dpi, height);
588
589 font_size = units_to_pixels(get_font_size(font), font->unit, dpi, FALSE);
591 stat = GdipGetLineSpacing(font->family, style, &line_spacing);
592 if (stat != Ok) return stat;
593 stat = GdipGetEmHeight(font->family, style, &em_height);
594 if (stat != Ok) return stat;
595
596 *height = (REAL)line_spacing * font_size / (REAL)em_height;
597
598 TRACE("%s,%ld => %f\n",
599 debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *height);
600
601 return Ok;
602}
unsigned short UINT16
Definition: actypes.h:129
static INT get_font_style(const GpFont *font)
Definition: font.c:364
GpStatus WINGDIPAPI GdipGetLineSpacing(GDIPCONST GpFontFamily *family, INT style, UINT16 *LineSpacing)
Definition: font.c:899
GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, UINT16 *EmHeight)
Definition: font.c:872
static REAL get_font_size(const GpFont *font)
Definition: font.c:331

Referenced by GdipGetFontHeight(), and test_heightgivendpi().

◆ GdipGetFontSize()

GpStatus WINGDIPAPI GdipGetFontSize ( GpFont font,
REAL size 
)

Definition at line 352 of file font.c.

353{
354 TRACE("(%p, %p)\n", font, size);
355
356 if (!(font && size)) return InvalidParameter;
357
359 TRACE("%s,%ld => %f\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *size);
360
361 return Ok;
362}
GLsizeiptr size
Definition: glext.h:5919

Referenced by gdip_get_font_metrics(), test_CloneFont(), test_createfont(), test_GdipMeasureString(), test_logfont(), and test_measured_extra_space().

◆ GdipGetFontStyle()

GpStatus WINGDIPAPI GdipGetFontStyle ( GpFont font,
INT style 
)

Definition at line 395 of file font.c.

396{
397 TRACE("%p %p\n", font, style);
398
399 if (!(font && style))
400 return InvalidParameter;
401
403 TRACE("%s,%ld => %d\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *style);
404
405 return Ok;
406}

Referenced by gdip_get_font_metrics(), METAFILE_AddFontObject(), test_CloneFont(), and test_logfont().

◆ GdipGetFontUnit()

GpStatus WINGDIPAPI GdipGetFontUnit ( GpFont font,
Unit unit 
)

Definition at line 419 of file font.c.

420{
421 TRACE("(%p, %p)\n", font, unit);
422
423 if (!(font && unit)) return InvalidParameter;
424
425 *unit = font->unit;
426 TRACE("%s,%ld => %d\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *unit);
427
428 return Ok;
429}

Referenced by test_CloneFont(), test_createfont(), test_font_metrics(), test_GdipMeasureString(), test_heightgivendpi(), and test_logfont().

◆ GdipGetGenericFontFamilyMonospace()

GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace ( GpFontFamily **  nativeFamily)

Definition at line 965 of file font.c.

966{
968
969 TRACE("(%p)\n", nativeFamily);
970
971 if (nativeFamily == NULL) return InvalidParameter;
972
973 stat = GdipCreateFontFamilyFromName(L"Courier New", NULL, nativeFamily);
974
976 stat = GdipCreateFontFamilyFromName(L"Liberation Mono", NULL, nativeFamily);
977
979 stat = GdipCreateFontFamilyFromName(L"Courier", NULL, nativeFamily);
980
981 return stat;
982}
#define L(x)
Definition: resources.c:13

Referenced by test_getgenerics().

◆ GdipGetGenericFontFamilySansSerif()

GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif ( GpFontFamily **  nativeFamily)

Definition at line 1029 of file font.c.

1030{
1031 GpStatus stat;
1032
1033 TRACE("(%p)\n", nativeFamily);
1034
1035 if (nativeFamily == NULL) return InvalidParameter;
1036
1037 stat = GdipCreateFontFamilyFromName(L"Microsoft Sans Serif", NULL, nativeFamily);
1038
1039 if (stat == FontFamilyNotFound)
1040 stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, nativeFamily);
1041
1042 if (stat == FontFamilyNotFound)
1043 stat = GdipCreateFontFamilyFromName(L"Arial", NULL, nativeFamily);
1044
1045 if (stat == FontFamilyNotFound)
1046 stat = GdipCreateFontFamilyFromName(L"Liberation Sans", NULL, nativeFamily);
1047
1048 return stat;
1049}

Referenced by GdipGetGenericFontFamilySerif(), METAFILE_PlaybackObject(), and test_getgenerics().

◆ GdipGetGenericFontFamilySerif()

GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif ( GpFontFamily **  nativeFamily)

Definition at line 997 of file font.c.

998{
1000
1001 TRACE("(%p)\n", nativeFamily);
1002
1003 if (nativeFamily == NULL) return InvalidParameter;
1004
1005 stat = GdipCreateFontFamilyFromName(L"Times New Roman", NULL, nativeFamily);
1006
1007 if (stat == FontFamilyNotFound)
1008 stat = GdipCreateFontFamilyFromName(L"Liberation Serif", NULL, nativeFamily);
1009
1010 if (stat == FontFamilyNotFound)
1012
1013 return stat;
1014}
GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily)
Definition: font.c:1029

Referenced by test_getgenerics().

◆ GdipGetLineSpacing()

GpStatus WINGDIPAPI GdipGetLineSpacing ( GDIPCONST GpFontFamily family,
INT  style,
UINT16 LineSpacing 
)

Definition at line 899 of file font.c.

901{
902 TRACE("%p, %d, %p\n", family, style, LineSpacing);
903
904 if (!(family && LineSpacing))
905 return InvalidParameter;
906
907 if (style) FIXME("ignoring style\n");
908
909 *LineSpacing = family->line_spacing;
910 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *LineSpacing);
911
912 return Ok;
913}

Referenced by gdip_get_font_metrics(), GdipGetFontHeightGivenDPI(), test_fontfamily_properties(), and test_logfont().

◆ GdipGetLogFontA()

GpStatus WINGDIPAPI GdipGetLogFontA ( GpFont font,
GpGraphics graphics,
LOGFONTA lfa 
)

Definition at line 434 of file font.c.

436{
438 LOGFONTW lfw;
439
440 TRACE("(%p, %p, %p)\n", font, graphics, lfa);
441
442 status = GdipGetLogFontW(font, graphics, &lfw);
443 if(status != Ok)
444 return status;
445
446 memcpy(lfa, &lfw, FIELD_OFFSET(LOGFONTA,lfFaceName) );
447
449 return GenericError;
450
451 return Ok;
452}
#define WideCharToMultiByte
Definition: compat.h:111
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
Definition: font.c:457
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55

Referenced by test_font_substitution(), test_font_transform(), and test_logfont().

◆ GdipGetLogFontW()

GpStatus WINGDIPAPI GdipGetLogFontW ( GpFont font,
GpGraphics graphics,
LOGFONTW lf 
)

Definition at line 457 of file font.c.

458{
459 REAL angle, rel_height, height;
461
462 TRACE("(%p, %p, %p)\n", font, graphics, lf);
463
464 if (!font || !graphics || !lf)
465 return InvalidParameter;
466
467 matrix = graphics->worldtrans;
468
469 if (font->unit == UnitPixel || font->unit == UnitWorld)
470 {
471 height = units_to_pixels(font->emSize, graphics->unit, graphics->yres, graphics->printer_display);
472 if (graphics->unit != UnitDisplay)
473 GdipScaleMatrix(&matrix, graphics->scale, graphics->scale, MatrixOrderAppend);
474 }
475 else
476 {
477 if (graphics->unit == UnitDisplay || graphics->unit == UnitPixel)
478 height = units_to_pixels(font->emSize, font->unit, graphics->xres, graphics->printer_display);
479 else
480 height = units_to_pixels(font->emSize, font->unit, graphics->yres, graphics->printer_display);
481 }
482
484 transform_properties(graphics, &matrix, FALSE, NULL, &rel_height, &angle);
485 get_log_fontW(font, graphics, lf);
486
487 lf->lfHeight = -gdip_round(height * rel_height);
488 lf->lfEscapement = lf->lfOrientation = gdip_round((angle / M_PI) * 1800.0);
489 if (lf->lfEscapement < 0)
490 {
491 lf->lfEscapement += 3600;
492 lf->lfOrientation += 3600;
493 }
494
495 TRACE("=> %s,%ld\n", debugstr_w(lf->lfFaceName), lf->lfHeight);
496
497 return Ok;
498}
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
Definition: matrix.c:288
GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, GpMatrixOrder order)
Definition: matrix.c:239
void transform_properties(GpGraphics *, GDIPCONST GpMatrix *, BOOL, REAL *, REAL *, REAL *)
Definition: graphics.c:5696
static INT gdip_round(REAL x)
void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *)
Definition: graphics.c:2353
@ MatrixOrderAppend
Definition: gdiplusenums.h:188
@ UnitDisplay
Definition: gdiplusenums.h:28
@ UnitPixel
Definition: gdiplusenums.h:29
GLuint GLenum matrix
Definition: glext.h:9407
GLfloat angle
Definition: glext.h:10853
#define M_PI
Definition: macros.h:263
GpMatrix worldtrans
BOOL printer_display
GpMatrix gdi_transform
LONG lfOrientation
Definition: dimm.idl:62
LONG lfEscapement
Definition: dimm.idl:61

Referenced by GdipGetLogFontA(), test_createfont_charset(), test_font_metrics(), and test_GdipMeasureString().

◆ GdipIsStyleAvailable()

GpStatus WINGDIPAPI GdipIsStyleAvailable ( GDIPCONST GpFontFamily family,
INT  style,
BOOL IsStyleAvailable 
)

Definition at line 930 of file font.c.

932{
933 HDC hdc;
934
935 TRACE("%p %d %p\n", family, style, IsStyleAvailable);
936
937 if (!(family && IsStyleAvailable))
938 return InvalidParameter;
939
940 *IsStyleAvailable = FALSE;
941
943
944 if(!EnumFontFamiliesW(hdc, family->FamilyName, font_has_style_proc, (LPARAM)style))
945 *IsStyleAvailable = TRUE;
946
947 DeleteDC(hdc);
948
949 return Ok;
950}
#define TRUE
Definition: types.h:120
static INT CALLBACK font_has_style_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
Definition: font.c:915

◆ GdipNewInstalledFontCollection()

GpStatus WINGDIPAPI GdipNewInstalledFontCollection ( GpFontCollection **  fontCollection)

Definition at line 1669 of file font.c.

1671{
1672 TRACE("(%p)\n",fontCollection);
1673
1674 if (!fontCollection)
1675 return InvalidParameter;
1676
1679 {
1680 struct add_font_param param;
1681 LOGFONTW lfw;
1682
1683 param.hdc = CreateCompatibleDC(0);
1684
1685 lfw.lfCharSet = DEFAULT_CHARSET;
1686 lfw.lfFaceName[0] = 0;
1687 lfw.lfPitchAndFamily = 0;
1688
1689 param.collection = &installedFontCollection;
1690 param.is_system = TRUE;
1691 if (!EnumFontFamiliesExW(param.hdc, &lfw, add_font_proc, (LPARAM)&param, 0))
1692 {
1694 DeleteDC(param.hdc);
1696 return param.stat;
1697 }
1698
1699 DeleteDC(param.hdc);
1700 }
1702
1703 *fontCollection = &installedFontCollection;
1704
1705 return Ok;
1706}
void free_installed_fonts(void)
Definition: font.c:1567
static CRITICAL_SECTION font_cs
Definition: font.c:120
static INT CALLBACK add_font_proc(const LOGFONTW *lfw, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
Definition: font.c:1579
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)

Referenced by GdipCreateFontFamilyFromName(), test_CloneFont(), test_GdipGetFontCollectionFamilyCount(), test_GdipGetFontCollectionFamilyList(), and test_installedfonts().

◆ GdipNewPrivateFontCollection()

GpStatus WINGDIPAPI GdipNewPrivateFontCollection ( GpFontCollection **  fontCollection)

Definition at line 1054 of file font.c.

1055{
1056 TRACE("%p\n", fontCollection);
1057
1058 if (!fontCollection)
1059 return InvalidParameter;
1060
1061 *fontCollection = calloc(1, sizeof(GpFontCollection));
1062 if (!*fontCollection) return OutOfMemory;
1063
1064 (*fontCollection)->FontFamilies = NULL;
1065 (*fontCollection)->count = 0;
1066 (*fontCollection)->allocated = 0;
1067
1068 TRACE("<-- %p\n", *fontCollection);
1069
1070 return Ok;
1071}

Referenced by test_GdipPrivateAddMemoryFont(), test_long_name(), and test_unknownfontdecode().

◆ GdipPrivateAddFontFile()

GpStatus WINGDIPAPI GdipPrivateAddFontFile ( GpFontCollection collection,
GDIPCONST WCHAR name 
)

Definition at line 1095 of file font.c.

1096{
1099 void *mem;
1101
1102 TRACE("%p, %s\n", collection, debugstr_w(name));
1103
1104 if (!collection || !name) return InvalidParameter;
1105
1108
1109 if (!GetFileSizeEx(file, &size) || size.u.HighPart)
1110 {
1112 return InvalidParameter;
1113 }
1114
1117 if (!mapping) return InvalidParameter;
1118
1121 if (!mem) return InvalidParameter;
1122
1123 /* GdipPrivateAddMemoryFont creates a copy of the memory block */
1126
1127 return status;
1128}
#define CloseHandle
Definition: compat.h:739
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define FILE_MAP_READ
Definition: compat.h:776
#define GetFileSizeEx
Definition: compat.h:757
#define MapViewOfFile
Definition: compat.h:745
#define FILE_SHARE_READ
Definition: compat.h:136
GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void *memory, INT length)
Definition: font.c:1479
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
Definition: fci.c:127
Definition: mem.c:349

Referenced by test_long_name(), and test_unknownfontdecode().

◆ GdipPrivateAddMemoryFont()

GpStatus WINGDIPAPI GdipPrivateAddMemoryFont ( GpFontCollection fontCollection,
GDIPCONST void memory,
INT  length 
)

Definition at line 1479 of file font.c.

1481{
1482 WCHAR *name;
1483 DWORD count = 0;
1484 HANDLE font;
1485 GpStatus ret = Ok;
1486 TRACE("%p, %p, %d\n", fontCollection, memory, length);
1487
1488 if (!fontCollection || !memory || !length)
1489 return InvalidParameter;
1490
1492 if (!name)
1493 return OutOfMemory;
1494
1496 TRACE("%s: %p/%lu\n", debugstr_w(name), font, count);
1497 if (!font || !count)
1499 else
1500 {
1501 struct add_font_param param;
1502 LOGFONTW lfw;
1503
1504 param.hdc = CreateCompatibleDC(0);
1505
1506 /* Truncate name if necessary, GDI32 can't deal with long names */
1507 if(lstrlenW(name) > LF_FACESIZE - 1)
1508 name[LF_FACESIZE - 1] = 0;
1509
1510 lfw.lfCharSet = DEFAULT_CHARSET;
1511 lstrcpyW(lfw.lfFaceName, name);
1512 lfw.lfPitchAndFamily = 0;
1513
1514 param.collection = fontCollection;
1515 param.is_system = FALSE;
1516 if (!EnumFontFamiliesExW(param.hdc, &lfw, add_font_proc, (LPARAM)&param, 0))
1517 ret = param.stat;
1518
1519 DeleteDC(param.hdc);
1520 }
1521 free(name);
1522 return ret;
1523}
#define lstrlenW
Definition: compat.h:750
#define NAME_ID_FULL_FONT_NAME
Definition: font.c:1143
static WCHAR * load_ttf_name_id(const BYTE *mem, DWORD_PTR size, DWORD id)
Definition: font.c:1386
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
static char memory[1024 *256]
Definition: process.c:122
HANDLE WINAPI AddFontMemResourceEx(_In_reads_bytes_(cjSize) PVOID pvFileView, _In_ DWORD cjSize, _Reserved_ PVOID pvResrved, _In_ DWORD *pNumFonts)

Referenced by GdipPrivateAddFontFile(), and test_GdipPrivateAddMemoryFont().

◆ get_font_metrics()

static BOOL get_font_metrics ( HDC  hdc,
struct font_metrics fm 
)
static

Definition at line 632 of file font.c.

633{
635 TT_OS2_V2 tt_os2;
636 TT_HHEA tt_hori;
637 LONG size;
638 UINT16 line_gap;
639
640 otm.otmSize = sizeof(otm);
641 if (!GetOutlineTextMetricsW(hdc, otm.otmSize, &otm)) return FALSE;
642
643 fm->em_height = otm.otmEMSquare;
645
646 memset(&tt_hori, 0, sizeof(tt_hori));
647 if (GetFontData(hdc, MS_HHEA_TAG, 0, &tt_hori, sizeof(tt_hori)) != GDI_ERROR)
648 {
649 fm->ascent = GET_BE_WORD(tt_hori.Ascender);
650 fm->descent = -GET_BE_WORD(tt_hori.Descender);
651 TRACE("hhea: ascent %d, descent %d\n", fm->ascent, fm->descent);
652 line_gap = GET_BE_WORD(tt_hori.LineGap);
653 fm->line_spacing = fm->ascent + fm->descent + line_gap;
654 TRACE("line_gap %u, line_spacing %u\n", line_gap, fm->line_spacing);
655 if (fm->ascent + fm->descent != 0) return TRUE;
656 }
657
659 if (size == GDI_ERROR) return FALSE;
660
661 if (size > sizeof(tt_os2)) size = sizeof(tt_os2);
662
663 memset(&tt_os2, 0, sizeof(tt_os2));
664 if (GetFontData(hdc, MS_OS2_TAG, 0, &tt_os2, size) != size) return FALSE;
665
666 fm->ascent = GET_BE_WORD(tt_os2.usWinAscent);
667 fm->descent = GET_BE_WORD(tt_os2.usWinDescent);
668 TRACE("usWinAscent %u, usWinDescent %u\n", fm->ascent, fm->descent);
669 if (fm->ascent + fm->descent == 0)
670 {
671 fm->ascent = GET_BE_WORD(tt_os2.sTypoAscender);
672 fm->descent = GET_BE_WORD(tt_os2.sTypoDescender);
673 TRACE("sTypoAscender %u, sTypoDescender %u\n", fm->ascent, fm->descent);
674 }
675 line_gap = GET_BE_WORD(tt_os2.sTypoLineGap);
676 fm->line_spacing = fm->ascent + fm->descent + line_gap;
677 TRACE("line_gap %u, line_spacing %u\n", line_gap, fm->line_spacing);
678 return TRUE;
679}
#define MS_HHEA_TAG
Definition: font.c:116
#define MS_OS2_TAG
Definition: font.c:115
long LONG
Definition: pedump.c:60
Definition: font.c:86
SHORT LineGap
Definition: font.c:90
SHORT Descender
Definition: font.c:89
SHORT Ascender
Definition: font.c:88
Definition: font.c:39
USHORT usWinAscent
Definition: font.c:72
USHORT sTypoDescender
Definition: font.c:70
USHORT usWinDescent
Definition: font.c:73
USHORT sTypoLineGap
Definition: font.c:71
USHORT sTypoAscender
Definition: font.c:69
int dpi
Definition: font.c:629
UINT16 em_height
Definition: font.c:628
UINT16 ascent
Definition: font.c:628
UINT16 line_spacing
Definition: font.c:628
UINT16 descent
Definition: font.c:628
DWORD WINAPI GetFontData(HDC hdc, DWORD dwTable, DWORD dwOffset, LPVOID lpvBuffer, DWORD cbData)
Definition: font.c:2801
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define GDI_ERROR
Definition: wingdi.h:1309

Referenced by add_font_proc().

◆ get_font_size()

static REAL get_font_size ( const GpFont font)
static

Definition at line 331 of file font.c.

332{
333 return font->emSize;
334}

Referenced by GdipGetFontHeightGivenDPI(), and GdipGetFontSize().

◆ get_font_style()

static INT get_font_style ( const GpFont font)
static

Definition at line 364 of file font.c.

365{
366 INT style;
367
368 if (font->otm.otmTextMetrics.tmWeight > FW_REGULAR)
370 else
372 if (font->otm.otmTextMetrics.tmItalic)
374 if (font->otm.otmTextMetrics.tmUnderlined)
376 if (font->otm.otmTextMetrics.tmStruckOut)
378
379 return style;
380}

Referenced by GdipGetFontHeightGivenDPI(), and GdipGetFontStyle().

◆ get_mac_code_page()

static WORD get_mac_code_page ( const tt_name_record name)
inlinestatic

Definition at line 1304 of file font.c.

1305{
1306 WORD encoding_id = GET_BE_WORD(name->encoding_id);
1307 if (encoding_id == TT_MAC_ID_SIMPLIFIED_CHINESE) return 10008; /* special case */
1308 return 10000 + encoding_id;
1309}
#define TT_MAC_ID_SIMPLIFIED_CHINESE
Definition: font.c:1141

Referenced by copy_name_table_string(), and match_name_table_language().

◆ is_font_installed_proc()

static INT CALLBACK is_font_installed_proc ( const LOGFONTW elf,
const TEXTMETRICW ntm,
DWORD  type,
LPARAM  lParam 
)
static

Definition at line 610 of file font.c.

612{
613 const ENUMLOGFONTW *elfW = (const ENUMLOGFONTW *)elf;
614 LOGFONTW *lf = (LOGFONTW *)lParam;
615
616 if (type & RASTER_FONTTYPE)
617 return 1;
618
619 *lf = *elf;
620 /* replace substituted font name by a real one */
622 return 0;
623}
WCHAR elfFullName[LF_FULLFACESIZE]
Definition: wingdi.h:3138

Referenced by GdipCreateFontFamilyFromName(), and is_font_installed().

◆ load_ttf_name_id()

static WCHAR * load_ttf_name_id ( const BYTE mem,
DWORD_PTR  size,
DWORD  id 
)
static

Definition at line 1386 of file font.c.

1387{
1388 static const WORD platform_id_table[] = {TT_PLATFORM_MICROSOFT, TT_PLATFORM_MACINTOSH, TT_PLATFORM_APPLE_UNICODE};
1390 const tt_header *header;
1391 const tt_name_table *name_table;
1392 const tt_name_record *name_record_table, *name_record;
1393 DWORD pos, ofs = 0, count;
1394 int i, j, res, best_lang = 0, best_index = -1;
1395
1396 if (sizeof(tt_header) > size)
1397 return NULL;
1398 header = (const tt_header*)mem;
1399 count = GET_BE_WORD(header->tables_no);
1400
1401 if (GET_BE_DWORD(header->version) != TT_HEADER_VERSION_1 &&
1403 return NULL;
1404
1405 pos = sizeof(*header);
1406 for (i = 0; i < count; i++)
1407 {
1409 pos += sizeof(*table_directory);
1410 if (memcmp(table_directory->tag, "name", 4) == 0)
1411 {
1412 ofs = GET_BE_DWORD(table_directory->offset);
1413 break;
1414 }
1415 }
1416 if (i >= count)
1417 return NULL;
1418
1419 if (ofs >= size)
1420 return NULL;
1421 pos = ofs + sizeof(*name_table);
1422 if (pos > size)
1423 return NULL;
1424 name_table = (const tt_name_table*)&mem[ofs];
1425 name_record_table = (const tt_name_record *)&mem[pos];
1426 count = GET_BE_WORD(name_table->count);
1427 if (GET_BE_WORD(name_table->string_offset) >= size - ofs) return NULL;
1428 ofs += GET_BE_WORD(name_table->string_offset);
1429 for (i = 0; i < ARRAY_SIZE(platform_id_table); i++)
1430 {
1431 for (j = 0; j < count; j++)
1432 {
1433 name_record = name_record_table + j;
1434 if ((const BYTE *)name_record - mem > size)
1435 return NULL;
1436
1437 if (GET_BE_WORD(name_record->platform_id) != platform_id_table[i]) continue;
1438 if (GET_BE_WORD(name_record->name_id) != id) continue;
1439 if (GET_BE_WORD(name_record->offset) >= size - ofs) return NULL;
1440 if (GET_BE_WORD(name_record->length) > size - ofs - GET_BE_WORD(name_record->offset)) return NULL;
1441
1443 if (res > best_lang)
1444 {
1445 best_lang = res;
1446 best_index = j;
1447 }
1448 }
1449
1450 if (best_index != -1)
1451 break;
1452 }
1453
1454 if (best_lang)
1455 {
1456 WCHAR *ret;
1457 name_record = (const tt_name_record*)(name_table + 1) + best_index;
1459 TRACE( "name %u found platform %u lang %04x %s\n", GET_BE_WORD(name_record->name_id),
1460 GET_BE_WORD(name_record->platform_id), GET_BE_WORD(name_record->language_id), debugstr_w( ret ));
1461 return ret;
1462 }
1463 return NULL;
1464}
#define ARRAY_SIZE(A)
Definition: main.h:20
static WCHAR * copy_name_table_string(const tt_name_record *name, const BYTE *data)
Definition: font.c:1357
static int match_name_table_language(const tt_name_record *name, LANGID lang)
Definition: font.c:1311
#define GET_BE_DWORD(x)
Definition: font.c:109
#define TT_HEADER_VERSION_1
Definition: font.c:1153
#define TT_HEADER_VERSION_CFF
Definition: font.c:1154
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: locale.c:1199
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802
GLuint res
Definition: glext.h:9613
GLuint id
Definition: glext.h:5910
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
USHORT LANGID
Definition: mui.h:9
static const WCHAR lang[]
Definition: wbemdisp.c:287

Referenced by font_name_from_file(), GdipPrivateAddMemoryFont(), and msi_get_font_file_version().

◆ match_name_table_language()

static int match_name_table_language ( const tt_name_record name,
LANGID  lang 
)
static

Definition at line 1311 of file font.c.

1312{
1313 LANGID name_lang;
1314
1315 switch (GET_BE_WORD(name->platform_id))
1316 {
1318 switch (GET_BE_WORD(name->encoding_id))
1319 {
1321 case TT_MS_ID_SYMBOL_CS:
1322 name_lang = GET_BE_WORD(name->language_id);
1323 break;
1324 default:
1325 return 0;
1326 }
1327 break;
1329 if (!IsValidCodePage( get_mac_code_page( name ))) return 0;
1330 name_lang = GET_BE_WORD(name->language_id);
1331 if (name_lang >= ARRAY_SIZE(mac_langid_table)) return 0;
1332 name_lang = mac_langid_table[name_lang];
1333 break;
1335 switch (GET_BE_WORD(name->encoding_id))
1336 {
1340 name_lang = GET_BE_WORD(name->language_id);
1341 if (name_lang >= ARRAY_SIZE(mac_langid_table)) return 0;
1342 name_lang = mac_langid_table[name_lang];
1343 break;
1344 default:
1345 return 0;
1346 }
1347 break;
1348 default:
1349 return 0;
1350 }
1351 if (name_lang == lang) return 3;
1352 if (PRIMARYLANGID( name_lang ) == PRIMARYLANGID( lang )) return 2;
1353 if (name_lang == MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT )) return 1;
1354 return 0;
1355}
#define TT_APPLE_ID_ISO_10646
Definition: font.c:1135
#define TT_MS_ID_UNICODE_CS
Definition: font.c:1139
#define TT_APPLE_ID_DEFAULT
Definition: font.c:1134
#define TT_APPLE_ID_UNICODE_2_0
Definition: font.c:1136
#define TT_MS_ID_SYMBOL_CS
Definition: font.c:1138
static const LANGID mac_langid_table[]
Definition: font.c:1180
BOOL WINAPI IsValidCodePage(UINT codepage)
Definition: locale.c:2081
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_ENGLISH
Definition: nls.h:52
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define PRIMARYLANGID(l)
Definition: nls.h:16

Referenced by get_ttf_nametable_entry(), and load_ttf_name_id().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( gdiplus  )

Variable Documentation

◆ critsect_debug

CRITICAL_SECTION_DEBUG critsect_debug
static
Initial value:
=
{
0, 0, &font_cs,
0, 0, { (DWORD_PTR)(__FILE__ ": font_cs") }
}
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: font.c:121
#define DWORD_PTR
Definition: treelist.c:76

Definition at line 121 of file font.c.

◆ font_cs

static CRITICAL_SECTION font_cs = { &critsect_debug, -1, 0, 0, 0, 0 }
static

Definition at line 120 of file font.c.

Referenced by GdipNewInstalledFontCollection().

◆ installedFontCollection

GpFontCollection installedFontCollection = {0}
static

Definition at line 118 of file font.c.

Referenced by free_installed_fonts(), and GdipNewInstalledFontCollection().

◆ mac_langid_table

const LANGID mac_langid_table[]
static

Definition at line 1180 of file font.c.

Referenced by match_name_table_language().