104#ifdef WORDS_BIGENDIAN
105#define GET_BE_WORD(x) (x)
106#define GET_BE_DWORD(x) (x)
108#define GET_BE_WORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x))
109#define GET_BE_DWORD(x) MAKELONG(GET_BE_WORD(HIWORD(x)), GET_BE_WORD(LOWORD(x)))
112#define MS_MAKE_TAG(ch0, ch1, ch2, ch3) \
113 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
114 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24))
115#define MS_OS2_TAG MS_MAKE_TAG('O','S','/','2')
116#define MS_HHEA_TAG MS_MAKE_TAG('h','h','e','a')
125 0, 0, { (
DWORD_PTR)(__FILE__
": font_cs") }
160 if (!fontFamily || !
font || emSize < 0.0)
163 TRACE(
"%p (%s), %f, %d, %d, %p\n", fontFamily,
166 memset(&lfw, 0,
sizeof(lfw));
191 (*font)->unit =
unit;
192 (*font)->emSize = emSize;
207 HFONT
hfont, oldfont;
325 if (!(
font && family))
372 if (
font->otm.otmTextMetrics.tmItalic)
374 if (
font->otm.otmTextMetrics.tmUnderlined)
376 if (
font->otm.otmTextMetrics.tmStruckOut)
440 TRACE(
"(%p, %p, %p)\n",
font, graphics, lfa);
462 TRACE(
"(%p, %p, %p)\n",
font, graphics, lf);
464 if (!
font || !graphics || !lf)
507 if(!
font || !cloneFont)
547 TRACE(
"%s,%ld => %f\n",
557 TRACE(
"%s,%ld(unit %d) => %f\n",
581 UINT16 line_spacing, em_height;
598 TRACE(
"%s,%ld => %f\n",
646 memset(&tt_hori, 0,
sizeof(tt_hori));
661 if (
size >
sizeof(tt_os2))
size =
sizeof(tt_os2);
663 memset(&tt_os2, 0,
sizeof(tt_os2));
712 if (!
name || !family)
732 TRACE(
"<-- %p\n", *family);
756 if (!family || !clone)
789 static int lang_fixme;
791 TRACE(
"%p, %p, %d\n", family,
name, language);
800 FIXME(
"No support for handling of multiple languages!\n");
839 *CellAscent = family->ascent;
848 TRACE(
"(%p, %d, %p)\n", family,
style, CellDescent);
852 *CellDescent = family->descent;
878 *EmHeight = family->em_height;
902 TRACE(
"%p, %d, %p\n", family,
style, LineSpacing);
904 if (!(family && LineSpacing))
909 *LineSpacing = family->line_spacing;
935 TRACE(
"%p %d %p\n", family,
style, IsStyleAvailable);
937 if (!(family && IsStyleAvailable))
940 *IsStyleAvailable =
FALSE;
945 *IsStyleAvailable =
TRUE;
969 TRACE(
"(%p)\n", nativeFamily);
1001 TRACE(
"(%p)\n", nativeFamily);
1033 TRACE(
"(%p)\n", nativeFamily);
1056 TRACE(
"%p\n", fontCollection);
1058 if (!fontCollection)
1064 (*fontCollection)->FontFamilies =
NULL;
1065 (*fontCollection)->count = 0;
1066 (*fontCollection)->allocated = 0;
1068 TRACE(
"<-- %p\n", *fontCollection);
1080 TRACE(
"%p\n", fontCollection);
1082 if (!fontCollection)
1086 free((*fontCollection)->FontFamilies);
1087 free(*fontCollection);
1130#define TT_PLATFORM_APPLE_UNICODE 0
1131#define TT_PLATFORM_MACINTOSH 1
1132#define TT_PLATFORM_MICROSOFT 3
1134#define TT_APPLE_ID_DEFAULT 0
1135#define TT_APPLE_ID_ISO_10646 2
1136#define TT_APPLE_ID_UNICODE_2_0 3
1138#define TT_MS_ID_SYMBOL_CS 0
1139#define TT_MS_ID_UNICODE_CS 1
1141#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
1143#define NAME_ID_FULL_FONT_NAME 4
1153#define TT_HEADER_VERSION_1 0x00010000
1154#define TT_HEADER_VERSION_CFF 0x4f54544f
1277 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1278 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1308 return 10000 + encoding_id;
1351 if (name_lang ==
lang)
return 3;
1369 for (
len = 0;
len < name_len / 2;
len++)
1394 int i,
j,
res, best_lang = 0, best_index = -1;
1405 pos =
sizeof(*header);
1409 pos +=
sizeof(*table_directory);
1421 pos = ofs +
sizeof(*name_table);
1443 if (
res > best_lang)
1450 if (best_index != -1)
1512 lfw.lfPitchAndFamily = 0;
1514 param.collection = fontCollection;
1531 TRACE(
"%p, %p\n", fontCollection, numFound);
1533 if (!(fontCollection && numFound))
1536 *numFound = fontCollection->
count;
1549 TRACE(
"%p, %d, %p, %p\n", fontCollection, numSought, gpfamilies, numFound);
1551 if (!(fontCollection && gpfamilies && numFound))
1554 memset(gpfamilies, 0,
sizeof(*gpfamilies) * numSought);
1556 for (
i = 0;
i < numSought &&
i < fontCollection->
count;
i++)
1585 HFONT
hfont, old_hfont;
1606 if (!new_family_list)
1618 family =
malloc(
sizeof(*family));
1621 if (
param->is_system)
1672 TRACE(
"(%p)\n",fontCollection);
1674 if (!fontCollection)
1686 lfw.lfFaceName[0] = 0;
1687 lfw.lfPitchAndFamily = 0;
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define INVALID_HANDLE_VALUE
#define CreateFileMappingW(a, b, c, d, e, f)
#define WideCharToMultiByte
#define MultiByteToWideChar
#define TT_APPLE_ID_ISO_10646
GpStatus WINGDIPAPI GdipGetFontSize(GpFont *font, REAL *size)
GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height)
static WORD get_mac_code_page(const tt_name_record *name)
#define NAME_ID_FULL_FONT_NAME
GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily *family, GpFontFamily **clone)
GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily *FontFamily)
GpStatus WINGDIPAPI GdipGetFamily(GpFont *font, GpFontFamily **family)
static INT get_font_style(const GpFont *font)
GpStatus WINGDIPAPI GdipDeleteFont(GpFont *font)
static WCHAR * load_ttf_name_id(const BYTE *mem, DWORD_PTR size, DWORD id)
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font)
static BOOL get_font_metrics(HDC hdc, struct font_metrics *fm)
GpStatus WINGDIPAPI GdipCreateFontFromLogfontA(HDC hdc, GDIPCONST LOGFONTA *lfa, GpFont **font)
static CRITICAL_SECTION_DEBUG critsect_debug
GpStatus WINGDIPAPI GdipGetLogFontA(GpFont *font, GpGraphics *graphics, LOGFONTA *lfa)
#define TT_MAC_ID_SIMPLIFIED_CHINESE
GpStatus WINGDIPAPI GdipCreateFontFromDC(HDC hdc, GpFont **font)
GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif(GpFontFamily **nativeFamily)
GpStatus WINGDIPAPI GdipGetCellDescent(GDIPCONST GpFontFamily *family, INT style, UINT16 *CellDescent)
GpStatus WINGDIPAPI GdipNewInstalledFontCollection(GpFontCollection **fontCollection)
GpStatus WINGDIPAPI GdipGetFontStyle(GpFont *font, INT *style)
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount(GpFontCollection *fontCollection, INT *numFound)
#define TT_MS_ID_UNICODE_CS
#define TT_PLATFORM_MICROSOFT
GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void *memory, INT length)
static WCHAR * copy_name_table_string(const tt_name_record *name, const BYTE *data)
void free_installed_fonts(void)
static GpFontCollection installedFontCollection
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily)
GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, REAL emSize, INT style, Unit unit, GpFont **font)
#define TT_APPLE_ID_DEFAULT
GpStatus WINGDIPAPI GdipGetCellAscent(GDIPCONST GpFontFamily *family, INT style, UINT16 *CellAscent)
#define TT_APPLE_ID_UNICODE_2_0
#define TT_PLATFORM_MACINTOSH
GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height)
#define TT_MS_ID_SYMBOL_CS
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList(GpFontCollection *fontCollection, INT numSought, GpFontFamily *gpfamilies[], INT *numFound)
GpStatus WINGDIPAPI GdipGetFontUnit(GpFont *font, Unit *unit)
GpStatus WINGDIPAPI GdipGetLineSpacing(GDIPCONST GpFontFamily *family, INT style, UINT16 *LineSpacing)
static CRITICAL_SECTION font_cs
GpStatus WINGDIPAPI GdipDeletePrivateFontCollection(GpFontCollection **fontCollection)
static INT CALLBACK is_font_installed_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
static int match_name_table_language(const tt_name_record *name, LANGID lang)
GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamily)
GpStatus WINGDIPAPI GdipIsStyleAvailable(GDIPCONST GpFontFamily *family, INT style, BOOL *IsStyleAvailable)
GpStatus WINGDIPAPI GdipGetFamilyName(GDIPCONST GpFontFamily *family, WCHAR *name, LANGID language)
#define TT_PLATFORM_APPLE_UNICODE
GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, UINT16 *EmHeight)
static REAL get_font_size(const GpFont *font)
GpStatus WINGDIPAPI GdipCloneFont(GpFont *font, GpFont **cloneFont)
GpStatus WINGDIPAPI GdipPrivateAddFontFile(GpFontCollection *collection, GDIPCONST WCHAR *name)
static INT CALLBACK font_has_style_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, GpFontCollection *collection, GpFontFamily **family)
GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection **fontCollection)
static INT CALLBACK add_font_proc(const LOGFONTW *lfw, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
#define TT_HEADER_VERSION_1
#define TT_HEADER_VERSION_CFF
static const LANGID mac_langid_table[]
GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL *dpi)
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, GpMatrixOrder order)
LANGID WINAPI GetSystemDefaultLangID(void)
BOOL WINAPI IsValidCodePage(UINT codepage)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi, BOOL printer_display)
REAL pixels_to_units(REAL pixels, GpUnit unit, REAL dpi, BOOL printer_display)
void transform_properties(GpGraphics *, GDIPCONST GpMatrix *, BOOL, REAL *, REAL *, REAL *)
static INT gdip_round(REAL x)
void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLuint GLsizei GLsizei * length
GLenum GLenum GLenum GLenum mapping
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
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
#define memcpy(s1, s2, n)
static char memory[1024 *256]
static ICollection collection
#define LANG_SCOTTISH_GAELIC
png_const_structrp png_const_inforp int * unit
#define SUBLANG_DUTCH_BELGIAN
#define LANG_CHINESE_SIMPLIFIED
#define LANG_CHINESE_TRADITIONAL
#define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA
#define SUBLANG_AZERI_CYRILLIC
#define SUBLANG_IRISH_IRELAND
#define SUBLANG_AZERI_LATIN
GpFontFamily ** FontFamilies
WCHAR FamilyName[LF_FACESIZE]
CHAR lfFaceName[LF_FACESIZE]
WCHAR lfFaceName[LF_FACESIZE]
SHORT minRightSideBearing
SHORT ySuperscriptYOffset
SHORT ySuperscriptXOffset
TEXTMETRICW otmTextMetrics
LIST_ENTRY ProcessLocksList
GpFontCollection * collection
WCHAR facename[LF_FACESIZE]
WCHAR elfFullName[LF_FULLFACESIZE]
#define FIELD_OFFSET(t, f)
static const WCHAR lang[]
DWORD WINAPI GetFontData(HDC hdc, DWORD dwTable, DWORD dwOffset, LPVOID lpvBuffer, DWORD cbData)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI EnumFontFamiliesW(_In_ HDC, _In_opt_ LPCWSTR, _In_ FONTENUMPROCW, _In_ LPARAM)
int WINAPI GetTextFaceW(_In_ HDC hdc, _In_ int c, _Out_writes_to_opt_(c, return) LPWSTR lpName)
UINT WINAPI GetOutlineTextMetricsW(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICW potm)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
BOOL WINAPI DeleteDC(_In_ HDC)
HANDLE WINAPI AddFontMemResourceEx(_In_reads_bytes_(cjSize) PVOID pvFileView, _In_ DWORD cjSize, _Reserved_ PVOID pvResrved, _In_ DWORD *pNumFonts)