ReactOS  0.4.14-dev-342-gdc047f9
font.c File Reference
#include <precomp.h>
#include <math.h>
#include <strsafe.h>
#include <debug.h>
Include dependency graph for font.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define MAXTCIINDEX   32
 
#define INITIAL_FAMILY_COUNT   64
 
#define IFFCX_CHARSET   1
 
#define IFFCX_STYLE   2
 
#define IEFF_UNICODE   1
 
#define IEFF_EXTENDED   2
 
#define EfdFontFamilies   3
 

Functions

static __inline INT GDI_ROUND (FLOAT val)
 
VOID FASTCALL FONT_TextMetricWToA (const TEXTMETRICW *ptmW, LPTEXTMETRICA ptmA)
 
static LPWSTR FONT_mbtowc (HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
 
static LPSTR FONT_GetCharsByRangeA (HDC hdc, UINT firstChar, UINT lastChar, PINT pByteLen)
 
VOID FASTCALL NewTextMetricW2A (NEWTEXTMETRICA *tma, NEWTEXTMETRICW *tmw)
 
VOID FASTCALL NewTextMetricExW2A (NEWTEXTMETRICEXA *tma, NEWTEXTMETRICEXW *tmw)
 
FORCEINLINE int FASTCALL IntFontFamilyCompareEx (const FONTFAMILYINFO *ffi1, const FONTFAMILYINFO *ffi2, DWORD dwCompareFlags)
 
static int __cdecl IntFontFamilyCompare (const void *ffi1, const void *ffi2)
 
int FASTCALL IntFontFamilyListUnique (FONTFAMILYINFO *InfoList, INT nCount, const LOGFONTW *plf, DWORD dwFlags)
 
static int FASTCALL IntEnumFontFamilies (HDC Dc, const LOGFONTW *LogFont, PVOID EnumProc, LPARAM lParam, DWORD dwFlags)
 
int WINAPI EnumFontFamiliesExW (HDC hdc, LPLOGFONTW lpLogfont, FONTENUMPROCW lpEnumFontFamExProc, LPARAM lParam, DWORD dwFlags)
 
int WINAPI EnumFontFamiliesW (HDC hdc, LPCWSTR lpszFamily, FONTENUMPROCW lpEnumFontFamProc, LPARAM lParam)
 
int WINAPI EnumFontFamiliesExA (HDC hdc, LPLOGFONTA lpLogfont, FONTENUMPROCA lpEnumFontFamExProc, LPARAM lParam, DWORD dwFlags)
 
int WINAPI EnumFontFamiliesA (HDC hdc, LPCSTR lpszFamily, FONTENUMPROCA lpEnumFontFamProc, LPARAM lParam)
 
DWORD WINAPI GetCharacterPlacementA (HDC hdc, LPCSTR lpString, INT uCount, INT nMaxExtent, GCP_RESULTSA *lpResults, DWORD dwFlags)
 
DWORD WINAPI GetCharacterPlacementW (HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, GCP_RESULTSW *lpResults, DWORD dwFlags)
 
DWORD WINAPI NewGetCharacterPlacementW (HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, GCP_RESULTSW *lpResults, DWORD dwFlags)
 
BOOL WINAPI GetCharABCWidthsFloatW (HDC hdc, UINT FirstChar, UINT LastChar, LPABCFLOAT abcF)
 
BOOL WINAPI GetCharWidthFloatW (HDC hdc, UINT iFirstChar, UINT iLastChar, PFLOAT pxBuffer)
 
BOOL WINAPI GetCharWidthW (HDC hdc, UINT iFirstChar, UINT iLastChar, LPINT lpBuffer)
 
BOOL WINAPI GetCharWidth32W (HDC hdc, UINT iFirstChar, UINT iLastChar, LPINT lpBuffer)
 
BOOL WINAPI GetCharABCWidthsW (HDC hdc, UINT FirstChar, UINT LastChar, LPABC lpabc)
 
BOOL WINAPI GetCharWidthA (HDC hdc, UINT iFirstChar, UINT iLastChar, LPINT lpBuffer)
 
BOOL WINAPI GetCharWidth32A (HDC hdc, UINT iFirstChar, UINT iLastChar, LPINT lpBuffer)
 
BOOL APIENTRY GetCharWidthFloatA (HDC hdc, UINT iFirstChar, UINT iLastChar, PFLOAT pxBuffer)
 
BOOL APIENTRY GetCharABCWidthsA (HDC hdc, UINT iFirstChar, UINT iLastChar, LPABC lpabc)
 
BOOL APIENTRY GetCharABCWidthsFloatA (HDC hdc, UINT iFirstChar, UINT iLastChar, LPABCFLOAT lpABCF)
 
BOOL WINAPI GetCharABCWidthsI (HDC hdc, UINT giFirst, UINT cgi, LPWORD pgi, LPABC lpabc)
 
BOOL WINAPI GetCharWidthI (HDC hdc, UINT giFirst, UINT cgi, LPWORD pgi, LPINT lpBuffer)
 
DWORD WINAPI GetFontLanguageInfo (HDC hDc)
 
DWORD WINAPI GetGlyphIndicesA (HDC hdc, LPCSTR lpstr, INT count, LPWORD pgi, DWORD flags)
 
DWORD WINAPI GetGlyphOutlineA (HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm, DWORD cbBuffer, LPVOID lpvBuffer, CONST MAT2 *lpmat2)
 
DWORD WINAPI GetGlyphOutlineW (HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm, DWORD cbBuffer, LPVOID lpvBuffer, CONST MAT2 *lpmat2)
 
DWORD WINAPI GetGlyphOutlineWow (DWORD a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, DWORD a5, DWORD a6)
 
UINT APIENTRY GetOutlineTextMetricsA (HDC hdc, UINT cbData, LPOUTLINETEXTMETRICA lpOTM)
 
static INT INTERNAL_YDSTOWS (XFORM *xForm, INT height)
 
static INT width_to_LP (XFORM *xForm, INT width)
 
static INT height_to_LP (XFORM *xForm, INT height)
 
UINT APIENTRY GetOutlineTextMetricsW (HDC hdc, UINT cbData, LPOUTLINETEXTMETRICW lpOTM)
 
DWORD WINAPI GetKerningPairsW (HDC hdc, ULONG cPairs, LPKERNINGPAIR pkpDst)
 
DWORD WINAPI GetKerningPairsA (HDC hDC, DWORD cPairs, LPKERNINGPAIR kern_pairA)
 
HFONT WINAPI CreateFontIndirectExA (const ENUMLOGFONTEXDVA *elfexd)
 
HFONT WINAPI CreateFontIndirectExW (const ENUMLOGFONTEXDVW *elfexd)
 
HFONT WINAPI CreateFontIndirectA (CONST LOGFONTA *lplf)
 
HFONT WINAPI CreateFontIndirectW (CONST LOGFONTW *lplf)
 
HFONT WINAPI CreateFontA (int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight, DWORD fdwItalic, DWORD fdwUnderline, DWORD fdwStrikeOut, DWORD fdwCharSet, DWORD fdwOutputPrecision, DWORD fdwClipPrecision, DWORD fdwQuality, DWORD fdwPitchAndFamily, LPCSTR lpszFace)
 
HFONT WINAPI CreateFontW (int nHeight, int nWidth, int nEscapement, int nOrientation, int nWeight, DWORD fnItalic, DWORD fdwUnderline, DWORD fdwStrikeOut, DWORD fdwCharSet, DWORD fdwOutputPrecision, DWORD fdwClipPrecision, DWORD fdwQuality, DWORD fdwPitchAndFamily, LPCWSTR lpszFace)
 
BOOL WINAPI CreateScalableFontResourceA (DWORD fdwHidden, LPCSTR lpszFontRes, LPCSTR lpszFontFile, LPCSTR lpszCurrentPath)
 
int WINAPI AddFontResourceExW (LPCWSTR lpszFilename, DWORD fl, PVOID pvReserved)
 
int WINAPI AddFontResourceExA (LPCSTR lpszFilename, DWORD fl, PVOID pvReserved)
 
int WINAPI AddFontResourceA (LPCSTR lpszFilename)
 
int WINAPI AddFontResourceW (LPCWSTR lpszFilename)
 
BOOL WINAPI RemoveFontResourceW (LPCWSTR lpFileName)
 
BOOL WINAPI RemoveFontResourceA (LPCSTR lpFileName)
 
BOOL WINAPI RemoveFontResourceExA (LPCSTR lpFileName, DWORD fl, PVOID pdv)
 
BOOL WINAPI RemoveFontResourceExW (LPCWSTR lpFileName, DWORD fl, PVOID pdv)
 
LONG WINAPI GdiGetCharDimensions (HDC hdc, LPTEXTMETRICW lptm, LONG *height)
 
BOOL WINAPI TranslateCharsetInfo (LPDWORD lpSrc, LPCHARSETINFO lpCs, DWORD flags)
 
DWORD WINAPI SetMapperFlags (HDC hDC, DWORD flags)
 
int WINAPI EnumFontsW (HDC hDC, LPCWSTR lpFaceName, FONTENUMPROCW FontFunc, LPARAM lParam)
 
int WINAPI EnumFontsA (HDC hDC, LPCSTR lpFaceName, FONTENUMPROCA FontFunc, LPARAM lParam)
 
INT WINAPI NewEnumFontFamiliesExW (HDC hDC, LPLOGFONTW lpLogfont, FONTENUMPROCW lpEnumFontFamExProcW, LPARAM lParam, DWORD dwFlags)
 
int WINAPI GdiAddFontResourceW (LPCWSTR lpszFilename, FLONG fl, DESIGNVECTOR *pdv)
 
HANDLE WINAPI AddFontMemResourceEx (PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD *pcFonts)
 
BOOL WINAPI RemoveFontMemResourceEx (HANDLE fh)
 
int WINAPI AddFontResourceTracking (LPCSTR lpString, int unknown)
 
int WINAPI RemoveFontResourceTracking (LPCSTR lpString, int unknown)
 
BOOL WINAPI CreateScalableFontResourceW (DWORD fdwHidden, LPCWSTR lpszFontRes, LPCWSTR lpszFontFile, LPCWSTR lpszCurrentPath)
 
BOOL WINAPI bInitSystemAndFontsDirectoriesW (LPWSTR *SystemDir, LPWSTR *FontsDir)
 
BOOL WINAPI EudcLoadLinkW (LPCWSTR pBaseFaceName, LPCWSTR pEudcFontPath, INT iPriority, INT iFontLinkType)
 
BOOL WINAPI EudcUnloadLinkW (LPCWSTR pBaseFaceName, LPCWSTR pEudcFontPath)
 
ULONG WINAPI GetEUDCTimeStamp (VOID)
 
DWORD WINAPI GetEUDCTimeStampExW (LPWSTR lpBaseFaceName)
 
ULONG WINAPI GetFontAssocStatus (HDC hdc)
 
DWORD WINAPI QueryFontAssocStatus (VOID)
 
VOID WINAPI UnloadNetworkFonts (DWORD unknown)
 
DWORD WINAPI GetFontData (HDC hdc, DWORD dwTable, DWORD dwOffset, LPVOID lpvBuffer, DWORD cbData)
 
DWORD WINAPI cGetTTFFromFOT (DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6, DWORD x7)
 

Variables

static const CHARSETINFO FONT_tci [MAXTCIINDEX]
 

Macro Definition Documentation

◆ EfdFontFamilies

#define EfdFontFamilies   3

Definition at line 2322 of file font.c.

◆ IEFF_EXTENDED

#define IEFF_EXTENDED   2

Definition at line 252 of file font.c.

◆ IEFF_UNICODE

#define IEFF_UNICODE   1

Definition at line 251 of file font.c.

◆ IFFCX_CHARSET

#define IFFCX_CHARSET   1

Definition at line 208 of file font.c.

◆ IFFCX_STYLE

#define IFFCX_STYLE   2

Definition at line 209 of file font.c.

◆ INITIAL_FAMILY_COUNT

#define INITIAL_FAMILY_COUNT   64

Definition at line 72 of file font.c.

◆ MAXTCIINDEX

#define MAXTCIINDEX   32

Definition at line 30 of file font.c.

◆ NDEBUG

#define NDEBUG

Definition at line 15 of file font.c.

Function Documentation

◆ AddFontMemResourceEx()

HANDLE WINAPI AddFontMemResourceEx ( PVOID  pbFont,
DWORD  cbFont,
PVOID  pdv,
DWORD pcFonts 
)

Definition at line 2455 of file font.c.

2461 {
2462  if ( pbFont && cbFont && pcFonts)
2463  {
2464  return NtGdiAddFontMemResourceEx(pbFont, cbFont, NULL, 0, pcFonts);
2465  }
2467  return NULL;
2468 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
smooth NULL
Definition: ftsmooth.c:416
#define SetLastError(x)
Definition: compat.h:417
HANDLE APIENTRY NtGdiAddFontMemResourceEx(IN PVOID pvBuffer, IN DWORD cjBuffer, IN DESIGNVECTOR *pdv, IN ULONG cjDV, OUT DWORD *pNumFonts)
Definition: font.c:498

Referenced by GdipPrivateAddMemoryFont().

◆ AddFontResourceA()

int WINAPI AddFontResourceA ( LPCSTR  lpszFilename)

Definition at line 2011 of file font.c.

2012 {
2013  NTSTATUS Status;
2014  PWSTR FilenameW;
2015  int rc = 0;
2016 
2017  Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
2018  if ( !NT_SUCCESS (Status) )
2019  {
2021  }
2022  else
2023  {
2024  rc = GdiAddFontResourceW ( FilenameW, 0, 0);
2025 
2026  HEAP_free ( FilenameW );
2027  }
2028  return rc;
2029 }
VOID HEAP_free(LPVOID memory)
Definition: heap.c:63
int WINAPI GdiAddFontResourceW(LPCWSTR lpszFilename, FLONG fl, DESIGNVECTOR *pdv)
Definition: font.c:2404
uint16_t * PWSTR
Definition: typedefs.h:54
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS HEAP_strdupA2W(LPWSTR *ppszW, LPCSTR lpszA)
Definition: heap.c:43
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:417
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ AddFontResourceExA()

int WINAPI AddFontResourceExA ( LPCSTR  lpszFilename,
DWORD  fl,
PVOID  pvReserved 
)

Definition at line 1981 of file font.c.

1982 {
1983  NTSTATUS Status;
1984  PWSTR FilenameW;
1985  int rc;
1986 
1987  if (fl & ~(FR_PRIVATE | FR_NOT_ENUM))
1988  {
1990  return 0;
1991  }
1992 
1993  Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
1994  if ( !NT_SUCCESS (Status) )
1995  {
1997  return 0;
1998  }
1999 
2000  rc = GdiAddFontResourceW ( FilenameW, fl, 0 );
2001  HEAP_free ( FilenameW );
2002  return rc;
2003 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
VOID HEAP_free(LPVOID memory)
Definition: heap.c:63
int WINAPI GdiAddFontResourceW(LPCWSTR lpszFilename, FLONG fl, DESIGNVECTOR *pdv)
Definition: font.c:2404
uint16_t * PWSTR
Definition: typedefs.h:54
LONG NTSTATUS
Definition: precomp.h:26
_In_ FLONG fl
Definition: winddi.h:1279
NTSTATUS HEAP_strdupA2W(LPWSTR *ppszW, LPCSTR lpszA)
Definition: heap.c:43
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:417
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

Referenced by test_long_names().

◆ AddFontResourceExW()

int WINAPI AddFontResourceExW ( LPCWSTR  lpszFilename,
DWORD  fl,
PVOID  pvReserved 
)

Definition at line 1964 of file font.c.

1965 {
1966  if (fl & ~(FR_PRIVATE | FR_NOT_ENUM))
1967  {
1969  return 0;
1970  }
1971 
1972  return GdiAddFontResourceW(lpszFilename, fl,0);
1973 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
int WINAPI GdiAddFontResourceW(LPCWSTR lpszFilename, FLONG fl, DESIGNVECTOR *pdv)
Definition: font.c:2404
_In_ FLONG fl
Definition: winddi.h:1279
#define SetLastError(x)
Definition: compat.h:417

◆ AddFontResourceTracking()

int WINAPI AddFontResourceTracking ( LPCSTR  lpString,
int  unknown 
)

Definition at line 2491 of file font.c.

2495 {
2496  UNIMPLEMENTED;
2498  return 0;
2499 }
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define UNIMPLEMENTED
Definition: debug.h:114

◆ AddFontResourceW()

int WINAPI AddFontResourceW ( LPCWSTR  lpszFilename)

Definition at line 2037 of file font.c.

2038 {
2039  return GdiAddFontResourceW ( lpszFilename, 0, 0 );
2040 }
int WINAPI GdiAddFontResourceW(LPCWSTR lpszFilename, FLONG fl, DESIGNVECTOR *pdv)
Definition: font.c:2404

◆ bInitSystemAndFontsDirectoriesW()

BOOL WINAPI bInitSystemAndFontsDirectoriesW ( LPWSTR SystemDir,
LPWSTR FontsDir 
)

Definition at line 2546 of file font.c.

2547 {
2548  UNIMPLEMENTED;
2550  return 0;
2551 }
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define UNIMPLEMENTED
Definition: debug.h:114

◆ cGetTTFFromFOT()

DWORD WINAPI cGetTTFFromFOT ( DWORD  x1,
DWORD  x2,
DWORD  x3,
DWORD  x4,
DWORD  x5,
DWORD  x6,
DWORD  x7 
)

Definition at line 2669 of file font.c.

2670 {
2671  UNIMPLEMENTED;
2673  return 0;
2674 }
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define UNIMPLEMENTED
Definition: debug.h:114

◆ CreateFontA()

HFONT WINAPI CreateFontA ( int  nHeight,
int  nWidth,
int  nEscapement,
int  nOrientation,
int  fnWeight,
DWORD  fdwItalic,
DWORD  fdwUnderline,
DWORD  fdwStrikeOut,
DWORD  fdwCharSet,
DWORD  fdwOutputPrecision,
DWORD  fdwClipPrecision,
DWORD  fdwQuality,
DWORD  fdwPitchAndFamily,
LPCSTR  lpszFace 
)

Definition at line 1844 of file font.c.

1860 {
1861  ANSI_STRING StringA;
1862  UNICODE_STRING StringU;
1863  HFONT ret;
1864 
1865  RtlInitAnsiString(&StringA, (LPSTR)lpszFace);
1866  RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
1867 
1868  ret = CreateFontW(nHeight,
1869  nWidth,
1870  nEscapement,
1871  nOrientation,
1872  fnWeight,
1873  fdwItalic,
1874  fdwUnderline,
1875  fdwStrikeOut,
1876  fdwCharSet,
1877  fdwOutputPrecision,
1878  fdwClipPrecision,
1879  fdwQuality,
1880  fdwPitchAndFamily,
1881  StringU.Buffer);
1882 
1883  RtlFreeUnicodeString(&StringU);
1884 
1885  return ret;
1886 }
#define TRUE
Definition: types.h:120
char * LPSTR
Definition: xmlstorage.h:182
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
int ret
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HFONT WINAPI CreateFontW(int nHeight, int nWidth, int nEscapement, int nOrientation, int nWeight, DWORD fnItalic, DWORD fdwUnderline, DWORD fdwStrikeOut, DWORD fdwCharSet, DWORD fdwOutputPrecision, DWORD fdwClipPrecision, DWORD fdwQuality, DWORD fdwPitchAndFamily, LPCWSTR lpszFace)
Definition: font.c:1894

Referenced by test_GetTextMetrics2().

◆ CreateFontIndirectA()

◆ CreateFontIndirectExA()

HFONT WINAPI CreateFontIndirectExA ( const ENUMLOGFONTEXDVA elfexd)

Definition at line 1657 of file font.c.

1658 {
1659  if (elfexd)
1660  {
1661  ENUMLOGFONTEXDVW Logfont;
1662 
1664  &Logfont.elfEnumLogfontEx );
1665 
1666  RtlCopyMemory( &Logfont.elfDesignVector,
1667  (PVOID) &elfexd->elfDesignVector,
1668  sizeof(DESIGNVECTOR));
1669 
1670  return NtGdiHfontCreate( &Logfont, 0, 0, 0, NULL);
1671  }
1672  else return NULL;
1673 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
HFONT APIENTRY NtGdiHfontCreate(IN PENUMLOGFONTEXDVW pelfw, IN ULONG cjElfw, IN LFTYPE lft, IN FLONG fl, IN PVOID pvCliData)
Definition: font.c:1193
smooth NULL
Definition: ftsmooth.c:416
DESIGNVECTOR elfDesignVector
Definition: wingdi.h:2770
DESIGNVECTOR elfDesignVector
Definition: wingdi.h:2775
ENUMLOGFONTEXW elfEnumLogfontEx
Definition: wingdi.h:2774
VOID WINAPI EnumLogFontExW2A(LPENUMLOGFONTEXA fontA, CONST ENUMLOGFONTEXW *fontW)
Definition: utils.c:402

Referenced by Test_CreateFontIndirectExA().

◆ CreateFontIndirectExW()

HFONT WINAPI CreateFontIndirectExW ( const ENUMLOGFONTEXDVW elfexd)

Definition at line 1681 of file font.c.

1682 {
1683  /* Msdn: Note, this function ignores the elfDesignVector member in
1684  ENUMLOGFONTEXDV.
1685  */
1686  if ( elfexd )
1687  {
1688  return NtGdiHfontCreate((PENUMLOGFONTEXDVW) elfexd, 0, 0, 0, NULL );
1689  }
1690  else return NULL;
1691 }
HFONT APIENTRY NtGdiHfontCreate(IN PENUMLOGFONTEXDVW pelfw, IN ULONG cjElfw, IN LFTYPE lft, IN FLONG fl, IN PVOID pvCliData)
Definition: font.c:1193
smooth NULL
Definition: ftsmooth.c:416

Referenced by CreateFontIndirectW(), and Test_CreateFontIndirectExW().

◆ CreateFontIndirectW()

HFONT WINAPI CreateFontIndirectW ( CONST LOGFONTW lplf)

Definition at line 1803 of file font.c.

1806 {
1807 #if 0
1808  static BOOL bDidTest = FALSE;
1809  if (!bDidTest)
1810  {
1811  bDidTest = TRUE;
1812  DoFontSystemUnittest();
1813  }
1814 #endif
1815  if (lplf)
1816  {
1817  ENUMLOGFONTEXDVW Logfont;
1818 
1819  RtlCopyMemory( &Logfont.elfEnumLogfontEx.elfLogFont, lplf, sizeof(LOGFONTW));
1820  // Need something other than just cleaning memory here.
1821  // Guess? Use caller data to determine the rest.
1823  sizeof(Logfont.elfEnumLogfontEx.elfFullName));
1825  sizeof(Logfont.elfEnumLogfontEx.elfStyle));
1827  sizeof(Logfont.elfEnumLogfontEx.elfScript));
1828 
1829  Logfont.elfDesignVector.dvNumAxes = 0; // No more than MM_MAX_NUMAXES
1830 
1831  RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR));
1832 
1833  return CreateFontIndirectExW(&Logfont);
1834  }
1835  else return NULL;
1836 }
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
WCHAR elfFullName[LF_FULLFACESIZE]
Definition: wingdi.h:2698
DWORD dvNumAxes
Definition: wingdi.h:2764
WCHAR elfStyle[LF_FACESIZE]
Definition: wingdi.h:2699
unsigned int BOOL
Definition: ntddk_ex.h:94
WCHAR elfScript[LF_FACESIZE]
Definition: wingdi.h:2700
smooth NULL
Definition: ftsmooth.c:416
DESIGNVECTOR elfDesignVector
Definition: wingdi.h:2775
LOGFONTW elfLogFont
Definition: wingdi.h:2697
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
HFONT WINAPI CreateFontIndirectExW(const ENUMLOGFONTEXDVW *elfexd)
Definition: font.c:1681
ENUMLOGFONTEXW elfEnumLogfontEx
Definition: wingdi.h:2774

Referenced by CreateConsoleFontEx(), CreateFontIndirectA(), CreateFontW(), find_installed_font(), gdi_get_font_metrics(), GdipCreateFont(), GdipCreateFontFromLogfontW(), and test_GetTextFace().

◆ CreateFontW()

HFONT WINAPI CreateFontW ( int  nHeight,
int  nWidth,
int  nEscapement,
int  nOrientation,
int  nWeight,
DWORD  fnItalic,
DWORD  fdwUnderline,
DWORD  fdwStrikeOut,
DWORD  fdwCharSet,
DWORD  fdwOutputPrecision,
DWORD  fdwClipPrecision,
DWORD  fdwQuality,
DWORD  fdwPitchAndFamily,
LPCWSTR  lpszFace 
)

Definition at line 1894 of file font.c.

1910 {
1911  LOGFONTW logfont;
1912 
1913  logfont.lfHeight = nHeight;
1914  logfont.lfWidth = nWidth;
1915  logfont.lfEscapement = nEscapement;
1916  logfont.lfOrientation = nOrientation;
1917  logfont.lfWeight = nWeight;
1918  logfont.lfItalic = (BYTE)fnItalic;
1919  logfont.lfUnderline = (BYTE)fdwUnderline;
1920  logfont.lfStrikeOut = (BYTE)fdwStrikeOut;
1921  logfont.lfCharSet = (BYTE)fdwCharSet;
1922  logfont.lfOutPrecision = (BYTE)fdwOutputPrecision;
1923  logfont.lfClipPrecision = (BYTE)fdwClipPrecision;
1924  logfont.lfQuality = (BYTE)fdwQuality;
1925  logfont.lfPitchAndFamily = (BYTE)fdwPitchAndFamily;
1926 
1927  if (NULL != lpszFace)
1928  {
1929  int Size = sizeof(logfont.lfFaceName) / sizeof(WCHAR);
1930  wcsncpy((wchar_t *)logfont.lfFaceName, lpszFace, Size - 1);
1931  /* Be 101% sure to have '\0' at end of string */
1932  logfont.lfFaceName[Size - 1] = '\0';
1933  }
1934  else
1935  {
1936  logfont.lfFaceName[0] = L'\0';
1937  }
1938 
1939  return CreateFontIndirectW(&logfont);
1940 }
HFONT WINAPI CreateFontIndirectW(CONST LOGFONTW *lplf)
Definition: font.c:1803
BYTE lfPitchAndFamily
Definition: dimm.idl:71
LONG lfHeight
Definition: dimm.idl:59
BYTE lfCharSet
Definition: dimm.idl:67
BYTE lfClipPrecision
Definition: dimm.idl:69
LONG lfEscapement
Definition: dimm.idl:61
LONG lfOrientation
Definition: dimm.idl:62
LONG lfWidth
Definition: dimm.idl:60
smooth NULL
Definition: ftsmooth.c:416
BYTE lfOutPrecision
Definition: dimm.idl:68
__wchar_t WCHAR
Definition: xmlstorage.h:180
BYTE lfQuality
Definition: dimm.idl:70
static const WCHAR L[]
Definition: oid.c:1250
unsigned char BYTE
Definition: mem.h:68
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
LONG lfWeight
Definition: dimm.idl:63
BYTE lfUnderline
Definition: dimm.idl:65

Referenced by CreateFontA(), and D3DXCreateFontIndirectW().

◆ CreateScalableFontResourceA()

BOOL WINAPI CreateScalableFontResourceA ( DWORD  fdwHidden,
LPCSTR  lpszFontRes,
LPCSTR  lpszFontFile,
LPCSTR  lpszCurrentPath 
)

Definition at line 1948 of file font.c.

1954 {
1955  return FALSE;
1956 }

Referenced by test_CreateScalableFontResource().

◆ CreateScalableFontResourceW()

BOOL WINAPI CreateScalableFontResourceW ( DWORD  fdwHidden,
LPCWSTR  lpszFontRes,
LPCWSTR  lpszFontFile,
LPCWSTR  lpszCurrentPath 
)

Definition at line 2515 of file font.c.

2521 {
2522  HANDLE f;
2523 
2524  UNIMPLEMENTED;
2525 
2526  /* fHidden=1 - only visible for the calling app, read-only, not
2527  * enumerated with EnumFonts/EnumFontFamilies
2528  * lpszCurrentPath can be NULL
2529  */
2530 
2531  /* If the output file already exists, return the ERROR_FILE_EXISTS error as specified in MSDN */
2532  if ((f = CreateFileW(lpszFontRes, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE)
2533  {
2534  CloseHandle(f);
2536  return FALSE;
2537  }
2538  return FALSE; /* create failed */
2539 }
#define ERROR_FILE_EXISTS
Definition: winerror.h:165
#define CloseHandle
Definition: compat.h:406
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:434
GLfloat f
Definition: glext.h:7540
#define SetLastError(x)
Definition: compat.h:417
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define f
Definition: ke_i.h:83
#define CreateFileW
Definition: compat.h:408
#define UNIMPLEMENTED
Definition: debug.h:114

◆ EnumFontFamiliesA()

int WINAPI EnumFontFamiliesA ( HDC  hdc,
LPCSTR  lpszFamily,
FONTENUMPROCA  lpEnumFontFamProc,
LPARAM  lParam 
)

Definition at line 480 of file font.c.

482 {
483  LOGFONTW LogFont;
484 
485  DPRINT("EnumFontFamiliesA(%p, %s, %p, %p)\n",
486  hdc, lpszFamily, lpEnumFontFamProc, lParam);
487 
488  ZeroMemory(&LogFont, sizeof(LOGFONTW));
489  LogFont.lfCharSet = DEFAULT_CHARSET;
490  if (NULL != lpszFamily)
491  {
492  if (!*lpszFamily) return 1;
493  MultiByteToWideChar(CP_THREAD_ACP, 0, lpszFamily, -1, LogFont.lfFaceName, LF_FACESIZE);
494  }
495 
496  return IntEnumFontFamilies(hdc, &LogFont, lpEnumFontFamProc, lParam, 0);
497 }
#define LF_FACESIZE
Definition: dimm.idl:39
BYTE lfCharSet
Definition: dimm.idl:67
#define ZeroMemory
Definition: winbase.h:1642
#define DEFAULT_CHARSET
Definition: wingdi.h:383
static int FASTCALL IntEnumFontFamilies(HDC Dc, const LOGFONTW *LogFont, PVOID EnumProc, LPARAM lParam, DWORD dwFlags)
Definition: font.c:288
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
HDC hdc
Definition: main.c:9
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define CP_THREAD_ACP
Definition: winnls.h:230
LPARAM lParam
Definition: combotst.c:139

Referenced by EnumFontsA(), is_font_installed(), is_font_installed_fullname(), is_truetype_font_installed(), test_bitmap_font(), test_EnumFontFamilies(), and test_EnumFonts().

◆ EnumFontFamiliesExA()

int WINAPI EnumFontFamiliesExA ( HDC  hdc,
LPLOGFONTA  lpLogfont,
FONTENUMPROCA  lpEnumFontFamExProc,
LPARAM  lParam,
DWORD  dwFlags 
)

Definition at line 447 of file font.c.

449 {
450  LOGFONTW LogFontW, *pLogFontW;
451 
452  if (lpLogfont)
453  {
454  DPRINT("EnumFontFamiliesExA(%p, %p(%s, %u, %u), %p, %p, 0x%08lX)\n",
455  hdc, lpLogfont, lpLogfont->lfFaceName, lpLogfont->lfCharSet,
456  lpLogfont->lfPitchAndFamily, lpEnumFontFamExProc, lParam, dwFlags);
457  }
458  else
459  {
460  DPRINT("EnumFontFamiliesExA(%p, NULL, %p, %p, 0x%08lX)\n",
461  hdc, lpEnumFontFamExProc, lParam, dwFlags);
462  }
463 
464  if (lpLogfont)
465  {
466  LogFontA2W(&LogFontW,lpLogfont);
467  pLogFontW = &LogFontW;
468  }
469  else pLogFontW = NULL;
470 
471  /* no need to convert LogFontW back to lpLogFont b/c it's an [in] parameter only */
472  return IntEnumFontFamilies(hdc, pLogFontW, lpEnumFontFamExProc, lParam, IEFF_EXTENDED);
473 }
BYTE lfPitchAndFamily
Definition: wingdi.h:1888
BYTE lfCharSet
Definition: wingdi.h:1884
VOID NTAPI LogFontA2W(LPLOGFONTW pW, CONST LOGFONTA *pA)
Definition: utils.c:348
CHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1889
static int FASTCALL IntEnumFontFamilies(HDC Dc, const LOGFONTW *LogFont, PVOID EnumProc, LPARAM lParam, DWORD dwFlags)
Definition: font.c:288
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define IEFF_EXTENDED
Definition: font.c:252
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LPARAM lParam
Definition: combotst.c:139

Referenced by test_bitmap_font_metrics(), test_east_asian_font_selection(), test_EnumFontFamilies(), test_EnumFontFamiliesEx_default_charset(), test_EnumFonts_subst(), test_fullname2_helper(), test_GetCharABCWidths(), test_GetGlyphOutline(), test_GetTextMetrics(), test_long_names(), and test_vertical_order().

◆ EnumFontFamiliesExW()

int WINAPI EnumFontFamiliesExW ( HDC  hdc,
LPLOGFONTW  lpLogfont,
FONTENUMPROCW  lpEnumFontFamExProc,
LPARAM  lParam,
DWORD  dwFlags 
)

Definition at line 400 of file font.c.

402 {
403  if (lpLogfont)
404  {
405  DPRINT("EnumFontFamiliesExW(%p, %p(%S, %u, %u), %p, %p, 0x%08lX)\n",
406  hdc, lpLogfont, lpLogfont->lfFaceName, lpLogfont->lfCharSet,
407  lpLogfont->lfPitchAndFamily, lpEnumFontFamExProc, lParam, dwFlags);
408  }
409  else
410  {
411  DPRINT("EnumFontFamiliesExW(%p, NULL, %p, %p, 0x%08lX)\n",
412  hdc, lpEnumFontFamExProc, lParam, dwFlags);
413  }
414  return IntEnumFontFamilies(hdc, lpLogfont, lpEnumFontFamExProc, lParam,
416 }
static int FASTCALL IntEnumFontFamilies(HDC Dc, const LOGFONTW *LogFont, PVOID EnumProc, LPARAM lParam, DWORD dwFlags)
Definition: font.c:288
void DPRINT(...)
Definition: polytest.cpp:61
#define IEFF_UNICODE
Definition: font.c:251
#define IEFF_EXTENDED
Definition: font.c:252
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
BYTE lfCharSet
Definition: wingdi.h:1900
BYTE lfPitchAndFamily
Definition: wingdi.h:1904
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1905
LPARAM lParam
Definition: combotst.c:139

Referenced by FaceNameList_Initialize(), FontTypeChange(), gdi_get_font_metrics(), GdipNewInstalledFontCollection(), GdipPrivateAddMemoryFont(), IsValidConsoleFont(), and test_EnumFontFamilies().

◆ EnumFontFamiliesW()

int WINAPI EnumFontFamiliesW ( HDC  hdc,
LPCWSTR  lpszFamily,
FONTENUMPROCW  lpEnumFontFamProc,
LPARAM  lParam 
)

Definition at line 423 of file font.c.

425 {
426  LOGFONTW LogFont;
427 
428  DPRINT("EnumFontFamiliesW(%p, %S, %p, %p)\n",
429  hdc, lpszFamily, lpEnumFontFamProc, lParam);
430 
431  ZeroMemory(&LogFont, sizeof(LOGFONTW));
432  LogFont.lfCharSet = DEFAULT_CHARSET;
433  if (NULL != lpszFamily)
434  {
435  if (!*lpszFamily) return 1;
436  lstrcpynW(LogFont.lfFaceName, lpszFamily, LF_FACESIZE);
437  }
438 
439  return IntEnumFontFamilies(hdc, &LogFont, lpEnumFontFamProc, lParam, IEFF_UNICODE);
440 }
#define LF_FACESIZE
Definition: dimm.idl:39
BYTE lfCharSet
Definition: dimm.idl:67
#define ZeroMemory
Definition: winbase.h:1642
#define DEFAULT_CHARSET
Definition: wingdi.h:383
#define lstrcpynW
Definition: compat.h:405
static int FASTCALL IntEnumFontFamilies(HDC Dc, const LOGFONTW *LogFont, PVOID EnumProc, LPARAM lParam, DWORD dwFlags)
Definition: font.c:288
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define IEFF_UNICODE
Definition: font.c:251
HDC hdc
Definition: main.c:9
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
LPARAM lParam
Definition: combotst.c:139

Referenced by EnumFontsW(), find_installed_font(), GdipIsStyleAvailable(), and test_EnumFontFamilies().

◆ EnumFontsA()

int WINAPI EnumFontsA ( HDC  hDC,
LPCSTR  lpFaceName,
FONTENUMPROCA  FontFunc,
LPARAM  lParam 
)

Definition at line 2295 of file font.c.

2301 {
2302 #if 0
2303  NTSTATUS Status;
2304  LPWSTR lpFaceNameW;
2305  int rc = 0;
2306 
2307  Status = HEAP_strdupA2W ( &lpFaceNameW, lpFaceName );
2308  if (!NT_SUCCESS (Status))
2310  else
2311  {
2312  rc = NtGdiEnumFonts ( hDC, lpFaceNameW, FontFunc, lParam );
2313 
2314  HEAP_free ( lpFaceNameW );
2315  }
2316  return rc;
2317 #else
2318  return EnumFontFamiliesA( hDC, lpFaceName, FontFunc, lParam );
2319 #endif
2320 }
VOID HEAP_free(LPVOID memory)
Definition: heap.c:63
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS HEAP_strdupA2W(LPWSTR *ppszW, LPCSTR lpszA)
Definition: heap.c:43
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
__kernel_entry W32KAPI BOOL APIENTRY NtGdiEnumFonts(_In_ HDC hdc, _In_ ULONG iEnumType, _In_ FLONG flWin31Compat, _In_ ULONG cchFaceName, _In_reads_opt_(cchFaceName) LPCWSTR pwszFaceName, _In_ ULONG lfCharSet, _Inout_ ULONG *pulCount, _Out_writes_bytes_opt_(*pulCount) PVOID pvUserModeBuffer)
#define SetLastError(x)
Definition: compat.h:417
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
static HDC hDC
Definition: 3dtext.c:33
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPARAM lParam
Definition: combotst.c:139
int WINAPI EnumFontFamiliesA(HDC hdc, LPCSTR lpszFamily, FONTENUMPROCA lpEnumFontFamProc, LPARAM lParam)
Definition: font.c:480

◆ EnumFontsW()

int WINAPI EnumFontsW ( HDC  hDC,
LPCWSTR  lpFaceName,
FONTENUMPROCW  FontFunc,
LPARAM  lParam 
)

Definition at line 2276 of file font.c.

2282 {
2283 #if 0
2284  return NtGdiEnumFonts ( hDC, lpFaceName, FontFunc, lParam );
2285 #else
2286  return EnumFontFamiliesW( hDC, lpFaceName, FontFunc, lParam );
2287 #endif
2288 }
int WINAPI EnumFontFamiliesW(HDC hdc, LPCWSTR lpszFamily, FONTENUMPROCW lpEnumFontFamProc, LPARAM lParam)
Definition: font.c:423
__kernel_entry W32KAPI BOOL APIENTRY NtGdiEnumFonts(_In_ HDC hdc, _In_ ULONG iEnumType, _In_ FLONG flWin31Compat, _In_ ULONG cchFaceName, _In_reads_opt_(cchFaceName) LPCWSTR pwszFaceName, _In_ ULONG lfCharSet, _Inout_ ULONG *pulCount, _Out_writes_bytes_opt_(*pulCount) PVOID pvUserModeBuffer)
static HDC hDC
Definition: 3dtext.c:33
LPARAM lParam
Definition: combotst.c:139

◆ EudcLoadLinkW()

BOOL WINAPI EudcLoadLinkW ( LPCWSTR  pBaseFaceName,
LPCWSTR  pEudcFontPath,
INT  iPriority,
INT  iFontLinkType 
)

Definition at line 2558 of file font.c.

2559 {
2560  UNIMPLEMENTED;
2562  return 0;
2563 }
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define UNIMPLEMENTED
Definition: debug.h:114

◆ EudcUnloadLinkW()

BOOL WINAPI EudcUnloadLinkW ( LPCWSTR  pBaseFaceName,
LPCWSTR  pEudcFontPath 
)

Definition at line 2570 of file font.c.

2571 {
2572  UNIMPLEMENTED;
2574  return 0;
2575 }
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define UNIMPLEMENTED
Definition: debug.h:114

◆ FONT_GetCharsByRangeA()

static LPSTR FONT_GetCharsByRangeA ( HDC  hdc,
UINT  firstChar,
UINT  lastChar,
PINT  pByteLen 
)
static

Definition at line 146 of file font.c.

147 {
148  INT i, count = lastChar - firstChar + 1;
149  UINT c;
150  LPSTR str;
151 
152  if (count <= 0)
153  return NULL;
154 
155  switch (GdiGetCodePage(hdc))
156  {
157  case 932:
158  case 936:
159  case 949:
160  case 950:
161  case 1361:
162  if (lastChar > 0xffff)
163  return NULL;
164  if ((firstChar ^ lastChar) > 0xff)
165  return NULL;
166  break;
167  default:
168  if (lastChar > 0xff)
169  return NULL;
170  break;
171  }
172 
173  str = HeapAlloc(GetProcessHeap(), 0, count * 2 + 1);
174  if (str == NULL)
175  return NULL;
176 
177  for(i = 0, c = firstChar; c <= lastChar; i++, c++)
178  {
179  if (c > 0xff)
180  str[i++] = (BYTE)(c >> 8);
181  str[i] = (BYTE)c;
182  }
183  str[i] = '\0';
184 
185  *pByteLen = i;
186 
187  return str;
188 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
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
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
const GLubyte * c
Definition: glext.h:8905
HDC hdc
Definition: main.c:9
unsigned char BYTE
Definition: mem.h:68
unsigned int UINT
Definition: ndis.h:50
#define c
Definition: ke_i.h:80
DWORD WINAPI GdiGetCodePage(HDC hdc)

Referenced by GetCharABCWidthsA(), GetCharABCWidthsFloatA(), GetCharWidth32A(), GetCharWidthA(), and GetCharWidthFloatA().

◆ FONT_mbtowc()

static LPWSTR FONT_mbtowc ( HDC  hdc,
LPCSTR  str,
INT  count,
INT plenW,
UINT pCP 
)
static

Definition at line 124 of file font.c.

125 {
126  UINT cp = GdiGetCodePage( hdc );
127  INT lenW;
128  LPWSTR strW;
129 
130  if(count == -1) count = strlen(str);
131  lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0);
132  strW = HeapAlloc(GetProcessHeap(), 0, lenW*sizeof(WCHAR));
133  if (!strW)
134  return NULL;
135  if(!MultiByteToWideChar(cp, 0, str, count, strW, lenW))
136  {
138  return NULL;
139  }
140  DPRINT("mapped %s -> %S\n", str, strW);
141  if(plenW) *plenW = lenW;
142  if(pCP) *pCP = cp;
143  return strW;
144 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
WCHAR strW[12]
Definition: clipboard.c:2029
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
HDC hdc
Definition: main.c:9
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
POINT cp
Definition: magnifier.c:59
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DWORD WINAPI GdiGetCodePage(HDC hdc)
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by GetCharABCWidthsA(), GetCharABCWidthsFloatA(), GetCharacterPlacementA(), GetCharWidth32A(), GetCharWidthA(), GetCharWidthFloatA(), GetGlyphIndicesA(), and GetGlyphOutlineA().

◆ FONT_TextMetricWToA()

VOID FASTCALL FONT_TextMetricWToA ( const TEXTMETRICW ptmW,
LPTEXTMETRICA  ptmA 
)

Definition at line 79 of file font.c.

80 {
81  ptmA->tmHeight = ptmW->tmHeight;
82  ptmA->tmAscent = ptmW->tmAscent;
83  ptmA->tmDescent = ptmW->tmDescent;
86  ptmA->tmAveCharWidth = ptmW->tmAveCharWidth;
87  ptmA->tmMaxCharWidth = ptmW->tmMaxCharWidth;
88  ptmA->tmWeight = ptmW->tmWeight;
89  ptmA->tmOverhang = ptmW->tmOverhang;
92  ptmA->tmFirstChar = min(ptmW->tmFirstChar, 255);
93  if (ptmW->tmCharSet == SYMBOL_CHARSET)
94  {
95  ptmA->tmFirstChar = 0x1e;
96  ptmA->tmLastChar = 0xff; /* win9x behaviour - we need the OS2 table data to calculate correctly */
97  }
98  else
99  {
100  ptmA->tmFirstChar = ptmW->tmDefaultChar - 1;
101  ptmA->tmLastChar = min(ptmW->tmLastChar, 0xff);
102  }
103  ptmA->tmDefaultChar = (CHAR)ptmW->tmDefaultChar;
104  ptmA->tmBreakChar = (CHAR)ptmW->tmBreakChar;
105  ptmA->tmItalic = ptmW->tmItalic;
106  ptmA->tmUnderlined = ptmW->tmUnderlined;
107  ptmA->tmStruckOut = ptmW->tmStruckOut;
108  ptmA->tmPitchAndFamily = ptmW->tmPitchAndFamily;
109  ptmA->tmCharSet = ptmW->tmCharSet;
110 }
LONG tmMaxCharWidth
Definition: wingdi.h:2384
BYTE tmUnderlined
Definition: wingdi.h:2394
LONG tmExternalLeading
Definition: wingdi.h:2382
char CHAR
Definition: xmlstorage.h:175
#define SYMBOL_CHARSET
Definition: wingdi.h:384
LONG tmAveCharWidth
Definition: wingdi.h:2383
LONG tmDescent
Definition: wingdi.h:2380
LONG tmAscent
Definition: wingdi.h:2379
LONG tmInternalLeading
Definition: wingdi.h:2381
LONG tmAveCharWidth
Definition: wingdi.h:2361
BYTE tmLastChar
Definition: wingdi.h:2368
LONG tmWeight
Definition: wingdi.h:2363
LONG tmDigitizedAspectY
Definition: wingdi.h:2366
BYTE tmPitchAndFamily
Definition: wingdi.h:2374
BYTE tmUnderlined
Definition: wingdi.h:2372
BYTE tmCharSet
Definition: wingdi.h:2375
BYTE tmFirstChar
Definition: wingdi.h:2367
BYTE tmPitchAndFamily
Definition: wingdi.h:2396
WCHAR tmBreakChar
Definition: wingdi.h:2392
BYTE tmStruckOut
Definition: wingdi.h:2395
BYTE tmDefaultChar
Definition: wingdi.h:2369
LONG tmHeight
Definition: wingdi.h:2356
LONG tmInternalLeading
Definition: wingdi.h:2359
LONG tmOverhang
Definition: wingdi.h:2386
LONG tmExternalLeading
Definition: wingdi.h:2360
LONG tmDescent
Definition: wingdi.h:2358
BYTE tmCharSet
Definition: wingdi.h:2397
LONG tmDigitizedAspectY
Definition: wingdi.h:2388
LONG tmAscent
Definition: wingdi.h:2357
LONG tmMaxCharWidth
Definition: wingdi.h:2362
BYTE tmStruckOut
Definition: wingdi.h:2373
BYTE tmItalic
Definition: wingdi.h:2371
LONG tmOverhang
Definition: wingdi.h:2364
#define min(a, b)
Definition: monoChain.cc:55
WCHAR tmDefaultChar
Definition: wingdi.h:2391
LONG tmDigitizedAspectX
Definition: wingdi.h:2365
LONG tmWeight
Definition: wingdi.h:2385
BYTE tmBreakChar
Definition: wingdi.h:2370
LONG tmHeight
Definition: wingdi.h:2378
#define CHAR(Char)
BYTE tmItalic
Definition: wingdi.h:2393
WCHAR tmFirstChar
Definition: wingdi.h:2389
WCHAR tmLastChar
Definition: wingdi.h:2390
LONG tmDigitizedAspectX
Definition: wingdi.h:2387

Referenced by GetOutlineTextMetricsA(), GetTextMetricsA(), and NewTextMetricW2A().

◆ GDI_ROUND()

static __inline INT GDI_ROUND ( FLOAT  val)
static

Definition at line 22 of file font.c.

23 {
24  return (int)floor(val + 0.5);
25 }
GLuint GLfloat * val
Definition: glext.h:7180
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)

Referenced by height_to_LP(), INTERNAL_YDSTOWS(), PATH_Ellipse(), PATH_RoundRect(), PATH_ScaleNormalizedPoint(), and width_to_LP().

◆ GdiAddFontResourceW()

int WINAPI GdiAddFontResourceW ( LPCWSTR  lpszFilename,
FLONG  fl,
DESIGNVECTOR pdv 
)

Definition at line 2404 of file font.c.

2408 {
2409  INT Ret;
2410  WCHAR lpszBuffer[MAX_PATH];
2411  WCHAR lpszAbsPath[MAX_PATH];
2412  UNICODE_STRING NtAbsPath;
2413 
2414  /* FIXME: We don't support multiple files passed in lpszFilename
2415  * as L"abcxxxxx.pfm|abcxxxxx.pfb"
2416  */
2417 
2418  /* Does the file exist in CurrentDirectory or in the Absolute Path passed? */
2419  GetCurrentDirectoryW(MAX_PATH, lpszBuffer);
2420 
2421  if (!SearchPathW(lpszBuffer, lpszFilename, NULL, MAX_PATH, lpszAbsPath, NULL))
2422  {
2423  /* Nope. Then let's check Fonts folder */
2424  GetWindowsDirectoryW(lpszBuffer, MAX_PATH);
2425  StringCbCatW(lpszBuffer, sizeof(lpszBuffer), L"\\Fonts");
2426 
2427  if (!SearchPathW(lpszBuffer, lpszFilename, NULL, MAX_PATH, lpszAbsPath, NULL))
2428  {
2429  DPRINT1("Font not found. The Buffer is: %ls, the FileName is: %S\n", lpszBuffer, lpszFilename);
2430  return 0;
2431  }
2432  }
2433 
2434  /* We found the font file so: */
2435  if (!RtlDosPathNameToNtPathName_U(lpszAbsPath, &NtAbsPath, NULL, NULL))
2436  {
2437  DPRINT1("Can't convert Path! Path: %ls\n", lpszAbsPath);
2438  return 0;
2439  }
2440 
2441  /* The Nt call expects a null-terminator included in cwc param. */
2442  ASSERT(NtAbsPath.Buffer[NtAbsPath.Length / sizeof(WCHAR)] == UNICODE_NULL);
2443  Ret = NtGdiAddFontResourceW(NtAbsPath.Buffer, NtAbsPath.Length / sizeof(WCHAR) + 1, 1, fl, 0, pdv);
2444 
2445  RtlFreeUnicodeString(&NtAbsPath);
2446 
2447  return Ret;
2448 }
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR * pdv
Definition: winddi.h:3723
INT APIENTRY NtGdiAddFontResourceW(IN WCHAR *pwcFiles, IN ULONG cwc, IN ULONG cFiles, IN FLONG fl, IN DWORD dwPidTid, IN OPTIONAL DESIGNVECTOR *pdv)
Definition: font.c:446
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:421
int32_t INT
Definition: typedefs.h:56
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
_In_ FLONG fl
Definition: winddi.h:1279
#define UNICODE_NULL
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1250
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1297
#define DPRINT1
Definition: precomp.h:8
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)

Referenced by AddFontResourceA(), AddFontResourceExA(), AddFontResourceExW(), and AddFontResourceW().

◆ GdiGetCharDimensions()

LONG WINAPI GdiGetCharDimensions ( HDC  hdc,
LPTEXTMETRICW  lptm,
LONG height 
)

Definition at line 2145 of file font.c.

2146 {
2147  SIZE sz;
2148  TEXTMETRICW tm;
2149  static const WCHAR alphabet[] =
2150  {
2151  'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
2152  'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
2153  'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0
2154  };
2155 
2156  if(!GetTextMetricsW(hdc, &tm)) return 0;
2157 
2158  if(!GetTextExtentPointW(hdc, alphabet, 52, &sz)) return 0;
2159 
2160  if (lptm) *lptm = tm;
2161  if (height) *height = tm.tmHeight;
2162 
2163  return (sz.cx / 26 + 1) / 2;
2164 }
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
LONG cx
Definition: windef.h:319
__wchar_t WCHAR
Definition: xmlstorage.h:180
HDC hdc
Definition: main.c:9
Definition: time.h:76
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static LPTEXTMETRICW lptm
Definition: font.c:42
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)

Referenced by create_taskdialog_template(), DIALOG_CreateIndirect(), EDIT_EM_SetMargins(), EDIT_UpdateUniscribeData_linedef(), GetDialogBaseUnits(), LoadDialog(), OleCreatePropertyFrameIndirect(), SoftModalMessageBox(), Test_GdiGetCharDimensions(), test_margins_default(), and test_margins_usefontinfo().

◆ GetCharABCWidthsA()

BOOL APIENTRY GetCharABCWidthsA ( HDC  hdc,
UINT  iFirstChar,
UINT  iLastChar,
LPABC  lpabc 
)

Definition at line 934 of file font.c.

940 {
941  INT wlen, count = 0;
942  LPSTR str;
943  LPWSTR wstr;
944  BOOL ret = TRUE;
945 
946  DPRINT("GetCharABCWidthsA\n");
947 
948  str = FONT_GetCharsByRangeA(hdc, iFirstChar, iLastChar, &count);
949  if (!str)
950  return FALSE;
951 
952  wstr = FONT_mbtowc(hdc, str, count+1, &wlen, NULL);
953  if (!wstr)
954  {
955  HeapFree(GetProcessHeap(), 0, str);
956  return FALSE;
957  }
958 
960  wstr[0],
961  wlen - 1,
962  (PWCHAR)wstr,
964  (PVOID)lpabc);
965 
966  HeapFree(GetProcessHeap(), 0, str);
967  HeapFree(GetProcessHeap(), 0, wstr);
968 
969  return ret;
970 }
#define TRUE
Definition: types.h:120
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharABCWidthsW(_In_ HDC hdc, _In_ UINT wchFirst, _In_ ULONG cwch, _In_reads_opt_(cwch) PWCHAR pwch, _In_ FLONG fl, _Out_writes_bytes_(cwch *sizeof(ABC)) PVOID pvBuf)
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint16_t * PWCHAR
Definition: typedefs.h:54
char * LPSTR
Definition: xmlstorage.h:182
#define GCABCW_NOFLOAT
Definition: ntgdityp.h:208
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define GetProcessHeap()
Definition: compat.h:403
int ret
HDC hdc
Definition: main.c:9
static LPSTR FONT_GetCharsByRangeA(HDC hdc, UINT firstChar, UINT lastChar, PINT pByteLen)
Definition: font.c:146
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
Definition: font.c:124
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by test_GetCharABCWidths().

◆ GetCharABCWidthsFloatA()

BOOL APIENTRY GetCharABCWidthsFloatA ( HDC  hdc,
UINT  iFirstChar,
UINT  iLastChar,
LPABCFLOAT  lpABCF 
)

Definition at line 977 of file font.c.

983 {
984  INT wlen, count = 0;
985  LPSTR str;
986  LPWSTR wstr;
987  BOOL ret = TRUE;
988 
989  DPRINT("GetCharABCWidthsFloatA\n");
990 
991  str = FONT_GetCharsByRangeA(hdc, iFirstChar, iLastChar, &count);
992  if (!str)
993  return FALSE;
994 
995  wstr = FONT_mbtowc( hdc, str, count+1, &wlen, NULL );
996  if (!wstr)
997  {
998  HeapFree( GetProcessHeap(), 0, str );
999  return FALSE;
1000  }
1001  ret = NtGdiGetCharABCWidthsW( hdc,wstr[0],(ULONG)count, (PWCHAR)wstr, 0, (PVOID)lpABCF);
1002 
1003  HeapFree( GetProcessHeap(), 0, str );
1004  HeapFree( GetProcessHeap(), 0, wstr );
1005 
1006  return ret;
1007 }
#define TRUE
Definition: types.h:120
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharABCWidthsW(_In_ HDC hdc, _In_ UINT wchFirst, _In_ ULONG cwch, _In_reads_opt_(cwch) PWCHAR pwch, _In_ FLONG fl, _Out_writes_bytes_(cwch *sizeof(ABC)) PVOID pvBuf)
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint16_t * PWCHAR
Definition: typedefs.h:54
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define GetProcessHeap()
Definition: compat.h:403
int ret
HDC hdc
Definition: main.c:9
static LPSTR FONT_GetCharsByRangeA(HDC hdc, UINT firstChar, UINT lastChar, PINT pByteLen)
Definition: font.c:146
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
Definition: font.c:124
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ GetCharABCWidthsFloatW()

BOOL WINAPI GetCharABCWidthsFloatW ( HDC  hdc,
UINT  FirstChar,
UINT  LastChar,
LPABCFLOAT  abcF 
)

Definition at line 686 of file font.c.

690 {
691  DPRINT("GetCharABCWidthsFloatW\n");
692  if ((!abcF) || (FirstChar > LastChar))
693  {
695  return FALSE;
696  }
697  return NtGdiGetCharABCWidthsW( hdc,
698  FirstChar,
699  (ULONG)(LastChar - FirstChar + 1),
700  (PWCHAR) NULL,
701  0,
702  (PVOID)abcF);
703 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharABCWidthsW(_In_ HDC hdc, _In_ UINT wchFirst, _In_ ULONG cwch, _In_reads_opt_(cwch) PWCHAR pwch, _In_ FLONG fl, _Out_writes_bytes_(cwch *sizeof(ABC)) PVOID pvBuf)
uint16_t * PWCHAR
Definition: typedefs.h:54
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:417
HDC hdc
Definition: main.c:9
unsigned int ULONG
Definition: retypes.h:1

◆ GetCharABCWidthsI()

BOOL WINAPI GetCharABCWidthsI ( HDC  hdc,
UINT  giFirst,
UINT  cgi,
LPWORD  pgi,
LPABC  lpabc 
)

Definition at line 1014 of file font.c.

1019 {
1020  DPRINT("GetCharABCWidthsI\n");
1021  return NtGdiGetCharABCWidthsW( hdc,
1022  giFirst,
1023  (ULONG) cgi,
1024  (PWCHAR) pgi,
1026  (PVOID)lpabc);
1027 }
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharABCWidthsW(_In_ HDC hdc, _In_ UINT wchFirst, _In_ ULONG cwch, _In_reads_opt_(cwch) PWCHAR pwch, _In_ FLONG fl, _Out_writes_bytes_(cwch *sizeof(ABC)) PVOID pvBuf)
uint16_t * PWCHAR
Definition: typedefs.h:54
#define GCABCW_NOFLOAT
Definition: ntgdityp.h:208
static LPCSTR INT LPWORD pgi
Definition: font.c:51
void DPRINT(...)
Definition: polytest.cpp:61
HDC hdc
Definition: main.c:9
#define GCABCW_INDICES
Definition: ntgdityp.h:209
unsigned int ULONG
Definition: retypes.h:1

Referenced by test_GetCharWidthI().

◆ GetCharABCWidthsW()

BOOL WINAPI GetCharABCWidthsW ( HDC  hdc,
UINT  FirstChar,
UINT  LastChar,
LPABC  lpabc 
)

Definition at line 787 of file font.c.

791 {
792  DPRINT("GetCharABCWidthsW\n");
793  if ((!lpabc) || (FirstChar > LastChar))
794  {
796  return FALSE;
797  }
798  return NtGdiGetCharABCWidthsW( hdc,
799  FirstChar,
800  (ULONG)(LastChar - FirstChar + 1),
801  (PWCHAR) NULL,
803  (PVOID)lpabc);
804 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharABCWidthsW(_In_ HDC hdc, _In_ UINT wchFirst, _In_ ULONG cwch, _In_reads_opt_(cwch) PWCHAR pwch, _In_ FLONG fl, _Out_writes_bytes_(cwch *sizeof(ABC)) PVOID pvBuf)
uint16_t * PWCHAR
Definition: typedefs.h:54
#define GCABCW_NOFLOAT
Definition: ntgdityp.h:208
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:417
HDC hdc
Definition: main.c:9
unsigned int ULONG
Definition: retypes.h:1

Referenced by check_vertical_metrics().

◆ GetCharacterPlacementA()

DWORD WINAPI GetCharacterPlacementA ( HDC  hdc,
LPCSTR  lpString,
INT  uCount,
INT  nMaxExtent,
GCP_RESULTSA lpResults,
DWORD  dwFlags 
)

Definition at line 505 of file font.c.

512 {
513  WCHAR *lpStringW;
514  INT uCountW;
515  GCP_RESULTSW resultsW;
516  DWORD ret;
517  UINT font_cp;
518 
519  if ( !lpString || uCount <= 0 || !lpResults || (nMaxExtent < 0 && nMaxExtent != -1 ) )
520  {
522  return 0;
523  }
524  /* TRACE("%s, %d, %d, 0x%08x\n",
525  debugstr_an(lpString, uCount), uCount, nMaxExtent, dwFlags);
526  */
527  /* both structs are equal in size */
528  memcpy(&resultsW, lpResults, sizeof(resultsW));
529 
530  lpStringW = FONT_mbtowc(hdc, lpString, uCount, &uCountW, &font_cp);
531  if (lpStringW == NULL)
532  {
533  return 0;
534  }
535  if(lpResults->lpOutString)
536  {
537  resultsW.lpOutString = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*uCountW);
538  if (resultsW.lpOutString == NULL)
539  {
540  HeapFree(GetProcessHeap(), 0, lpStringW);
541  return 0;
542  }
543  }
544 
545  ret = GetCharacterPlacementW(hdc, lpStringW, uCountW, nMaxExtent, &resultsW, dwFlags);
546 
547  lpResults->nGlyphs = resultsW.nGlyphs;
548  lpResults->nMaxFit = resultsW.nMaxFit;
549 
550  if(lpResults->lpOutString)
551  {
552  WideCharToMultiByte(font_cp, 0, resultsW.lpOutString, uCountW,
553  lpResults->lpOutString, uCount, NULL, NULL );
554  }
555 
556  HeapFree(GetProcessHeap(), 0, lpStringW);
557  HeapFree(GetProcessHeap(), 0, resultsW.lpOutString);
558 
559  return ret;
560 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define WideCharToMultiByte
Definition: compat.h:101
LPSTR lpOutString
Definition: wingdi.h:2416
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
LPWSTR lpOutString
Definition: wingdi.h:2427
int ret
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int UINT
Definition: ndis.h:50
static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
Definition: font.c:124
#define HeapFree(x, y, z)
Definition: compat.h:402
DWORD WINAPI GetCharacterPlacementW(HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, GCP_RESULTSW *lpResults, DWORD dwFlags)
Definition: font.c:568

Referenced by test_GetCharacterPlacement().

◆ GetCharacterPlacementW()

DWORD WINAPI GetCharacterPlacementW ( HDC  hdc,
LPCWSTR  lpString,
INT  uCount,
INT  nMaxExtent,
GCP_RESULTSW lpResults,
DWORD  dwFlags 
)

Definition at line 568 of file font.c.

576 {
577  DWORD ret=0;
578  SIZE size;
579  UINT i, nSet;
580  DPRINT("GetCharacterPlacementW\n");
581 
582  if (dwFlags&(~GCP_REORDER)) DPRINT("flags 0x%08lx ignored\n", dwFlags);
583  if (lpResults->lpClass) DPRINT("classes not implemented\n");
584 
585  nSet = (UINT)uCount;
586  if (nSet > lpResults->nGlyphs)
587  nSet = lpResults->nGlyphs;
588 
589  /* return number of initialized fields */
590  lpResults->nGlyphs = nSet;
591 
592  if (dwFlags & GCP_REORDER)
593  {
594  if (LoadLPK(LPK_GCP))
595  return LpkGetCharacterPlacement(hdc, lpString, uCount, nMaxExtent, lpResults, dwFlags, 0);
596  }
597 
598  /* Treat the case where no special handling was requested in a fastpath way */
599  /* copy will do if the GCP_REORDER flag is not set */
600  if (lpResults->lpOutString)
601  lstrcpynW( lpResults->lpOutString, lpString, nSet );
602 
603  if (lpResults->lpOrder)
604  {
605  for (i = 0; i < nSet; i++)
606  lpResults->lpOrder[i] = i;
607  }
608 
609  /* FIXME: Will use the placement chars */
610  if (lpResults->lpDx)
611  {
612  int c;
613  for (i = 0; i < nSet; i++)
614  {
615  if (GetCharWidth32W(hdc, lpString[i], lpString[i], &c))
616  lpResults->lpDx[i]= c;
617  }
618  }
619 
620  if (lpResults->lpCaretPos && !(dwFlags & GCP_REORDER))
621  {
622  int pos = 0;
623 
624  lpResults->lpCaretPos[0] = 0;
625  for (i = 1; i < nSet; i++)
626  if (GetTextExtentPoint32W(hdc, &(lpString[i - 1]), 1, &size))
627  lpResults->lpCaretPos[i] = (pos += size.cx);
628  }
629 
630  if (lpResults->lpGlyphs)
631  NtGdiGetGlyphIndicesW(hdc, lpString, nSet, lpResults->lpGlyphs, 0);
632 
633  if (GetTextExtentPoint32W(hdc, lpString, uCount, &size))
634  ret = MAKELONG(size.cx, size.cy);
635 
636  return ret;
637 }
LPWSTR lpGlyphs
Definition: wingdi.h:2432
__kernel_entry W32KAPI DWORD APIENTRY NtGdiGetGlyphIndicesW(_In_ HDC hdc, _In_reads_opt_(cwc) LPCWSTR pwc, _In_ INT cwc, _Out_writes_opt_(cwc) LPWORD pgi, _In_ DWORD iMode)
Definition: freetype.c:7300
#define lstrcpynW
Definition: compat.h:405
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
BOOL WINAPI LoadLPK(INT LpkFunctionID)
Definition: utils.c:423
#define MAKELONG(a, b)
Definition: typedefs.h:248
LPWSTR lpClass
Definition: wingdi.h:2431
void DPRINT(...)
Definition: polytest.cpp:61
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
unsigned long DWORD
Definition: ntddk_ex.h:95
LPWSTR lpOutString
Definition: wingdi.h:2427
int ret
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static const WORD INT INT LPINT LPINT LPSIZE size
Definition: font.c:53
unsigned int UINT
Definition: ndis.h:50
LPKGCP LpkGetCharacterPlacement
Definition: utils.c:6
UINT * lpOrder
Definition: wingdi.h:2428
#define GCP_REORDER
Definition: wingdi.h:842
BOOL WINAPI GetCharWidth32W(HDC hdc, UINT iFirstChar, UINT iLastChar, LPINT lpBuffer)
Definition: font.c:761
#define c
Definition: ke_i.h:80
#define LPK_GCP
Definition: gdi32p.h:83
INT * lpCaretPos
Definition: wingdi.h:2430
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)

Referenced by GetCharacterPlacementA().

◆ GetCharWidth32A()

BOOL WINAPI GetCharWidth32A ( HDC  hdc,
UINT  iFirstChar,
UINT  iLastChar,
LPINT  lpBuffer 
)

Definition at line 854 of file font.c.

860 {
861  INT wlen, count = 0;
862  LPSTR str;
863  LPWSTR wstr;
864  BOOL ret = TRUE;
865 
866  DPRINT("GetCharWidths32A\n");
867 
868  str = FONT_GetCharsByRangeA(hdc, iFirstChar, iLastChar, &count);
869  if (!str)
870  return FALSE;
871 
872  wstr = FONT_mbtowc(hdc, str, count+1, &wlen, NULL);
873  if (!wstr)
874  {
875  HeapFree(GetProcessHeap(), 0, str);
876  return FALSE;
877  }
878 
880  wstr[0],
881  (ULONG) count,
882  (PWCHAR) wstr,
884  (PVOID) lpBuffer);
885 
886  HeapFree(GetProcessHeap(), 0, str);
887  HeapFree(GetProcessHeap(), 0, wstr);
888 
889  return ret;
890 }
#define GCW_NOFLOAT
Definition: ntgdityp.h:204
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define GCW_WIN32
Definition: ntgdityp.h:203
uint16_t * PWCHAR
Definition: typedefs.h:54
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define GetProcessHeap()
Definition: compat.h:403
int ret
HDC hdc
Definition: main.c:9
static LPSTR FONT_GetCharsByRangeA(HDC hdc, UINT firstChar, UINT lastChar, PINT pByteLen)
Definition: font.c:146
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharWidthW(_In_ HDC hdc, _In_ UINT wcFirst, _In_ UINT cwc, _In_reads_opt_(cwc) PWCHAR pwc, _In_ FLONG fl, _Out_writes_bytes_(cwc *sizeof(ULONG)) PVOID pvBuf)
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
Definition: font.c:124
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ GetCharWidth32W()

BOOL WINAPI GetCharWidth32W ( HDC  hdc,
UINT  iFirstChar,
UINT  iLastChar,
LPINT  lpBuffer 
)

Definition at line 761 of file font.c.

765 {
766  DPRINT("GetCharWidths32W\n");
767  if ((!lpBuffer) || (iFirstChar > iLastChar))
768  {
770  return FALSE;
771  }
772  return NtGdiGetCharWidthW( hdc,
773  iFirstChar,
774  (ULONG)(iLastChar - iFirstChar + 1),
775  (PWCHAR) NULL,
777  (PVOID) lpBuffer);
778 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define GCW_NOFLOAT
Definition: ntgdityp.h:204
#define GCW_WIN32
Definition: ntgdityp.h:203
uint16_t * PWCHAR
Definition: typedefs.h:54
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:417
HDC hdc
Definition: main.c:9
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharWidthW(_In_ HDC hdc, _In_ UINT wcFirst, _In_ UINT cwc, _In_reads_opt_(cwc) PWCHAR pwc, _In_ FLONG fl, _Out_writes_bytes_(cwc *sizeof(ULONG)) PVOID pvBuf)
unsigned int ULONG
Definition: retypes.h:1

Referenced by GetCharacterPlacementW().

◆ GetCharWidthA()

BOOL WINAPI GetCharWidthA ( HDC  hdc,
UINT  iFirstChar,
UINT  iLastChar,
LPINT  lpBuffer 
)

Definition at line 811 of file font.c.

817 {
818  INT wlen, count = 0;
819  LPSTR str;
820  LPWSTR wstr;
821  BOOL ret = TRUE;
822 
823  DPRINT("GetCharWidthsA\n");
824 
825  str = FONT_GetCharsByRangeA(hdc, iFirstChar, iLastChar, &count);
826  if (!str)
827  return FALSE;
828 
829  wstr = FONT_mbtowc(hdc, str, count+1, &wlen, NULL);
830  if (!wstr)
831  {
832  HeapFree(GetProcessHeap(), 0, str);
833  return FALSE;
834  }
835 
837  wstr[0],
838  (ULONG) count,
839  (PWCHAR) wstr,
840  GCW_NOFLOAT,
841  (PVOID) lpBuffer);
842 
843  HeapFree(GetProcessHeap(), 0, str);
844  HeapFree(GetProcessHeap(), 0, wstr);
845 
846  return ret;
847 }
#define GCW_NOFLOAT
Definition: ntgdityp.h:204
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint16_t * PWCHAR
Definition: typedefs.h:54
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define GetProcessHeap()
Definition: compat.h:403
int ret
HDC hdc
Definition: main.c:9
static LPSTR FONT_GetCharsByRangeA(HDC hdc, UINT firstChar, UINT lastChar, PINT pByteLen)
Definition: font.c:146
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharWidthW(_In_ HDC hdc, _In_ UINT wcFirst, _In_ UINT cwc, _In_reads_opt_(cwc) PWCHAR pwc, _In_ FLONG fl, _Out_writes_bytes_(cwc *sizeof(ULONG)) PVOID pvBuf)
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
Definition: font.c:124
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by test_bitmap_font(), test_font_metrics(), and test_outline_font().

◆ GetCharWidthFloatA()

BOOL APIENTRY GetCharWidthFloatA ( HDC  hdc,
UINT  iFirstChar,
UINT  iLastChar,
PFLOAT  pxBuffer 
)

Definition at line 897 of file font.c.

903 {
904  INT wlen, count = 0;
905  LPSTR str;
906  LPWSTR wstr;
907  BOOL ret = TRUE;
908 
909  DPRINT("GetCharWidthsFloatA\n");
910 
911  str = FONT_GetCharsByRangeA(hdc, iFirstChar, iLastChar, &count);
912  if (!str)
913  return FALSE;
914 
915  wstr = FONT_mbtowc(hdc, str, count+1, &wlen, NULL);
916  if (!wstr)
917  {
918  HeapFree(GetProcessHeap(), 0, str);
919  return FALSE;
920  }
921  ret = NtGdiGetCharWidthW( hdc, wstr[0], (ULONG) count, (PWCHAR) wstr, 0, (PVOID) pxBuffer);
922 
923  HeapFree(GetProcessHeap(), 0, str);
924  HeapFree(GetProcessHeap(), 0, wstr);
925 
926  return ret;
927 }
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint16_t * PWCHAR
Definition: typedefs.h:54
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define GetProcessHeap()
Definition: compat.h:403
int ret
HDC hdc
Definition: main.c:9
static LPSTR FONT_GetCharsByRangeA(HDC hdc, UINT firstChar, UINT lastChar, PINT pByteLen)
Definition: font.c:146
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharWidthW(_In_ HDC hdc, _In_ UINT wcFirst, _In_ UINT cwc, _In_reads_opt_(cwc) PWCHAR pwc, _In_ FLONG fl, _Out_writes_bytes_(cwc *sizeof(ULONG)) PVOID pvBuf)
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
Definition: font.c:124
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ GetCharWidthFloatW()

BOOL WINAPI GetCharWidthFloatW ( HDC  hdc,
UINT  iFirstChar,
UINT  iLastChar,
PFLOAT  pxBuffer 
)

Definition at line 711 of file font.c.

715 {
716  DPRINT("GetCharWidthsFloatW\n");
717  if ((!pxBuffer) || (iFirstChar > iLastChar))
718  {
720  return FALSE;
721  }
722  return NtGdiGetCharWidthW( hdc,
723  iFirstChar,
724  (ULONG)(iLastChar - iFirstChar + 1),
725  (PWCHAR) NULL,
726  0,
727  (PVOID) pxBuffer);
728 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
uint16_t * PWCHAR
Definition: typedefs.h:54
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:417
HDC hdc
Definition: main.c:9
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharWidthW(_In_ HDC hdc, _In_ UINT wcFirst, _In_ UINT cwc, _In_reads_opt_(cwc) PWCHAR pwc, _In_ FLONG fl, _Out_writes_bytes_(cwc *sizeof(ULONG)) PVOID pvBuf)
unsigned int ULONG
Definition: retypes.h:1

◆ GetCharWidthI()

BOOL WINAPI GetCharWidthI ( HDC  hdc,
UINT  giFirst,
UINT  cgi,
LPWORD  pgi,
LPINT  lpBuffer 
)

Definition at line 1034 of file font.c.

1040 {
1041  DPRINT("GetCharWidthsI\n");
1042  if (!lpBuffer || (!pgi && (giFirst == MAXUSHORT))) // Cannot be at max.
1043  {
1045  return FALSE;
1046  }
1047  if (!cgi) return TRUE;
1048  return NtGdiGetCharWidthW( hdc,
1049  giFirst,
1050  cgi,
1051  (PWCHAR) pgi,
1053  (PVOID) lpBuffer );
1054 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define GCW_NOFLOAT
Definition: ntgdityp.h:204
#define TRUE
Definition: types.h:120
#define GCW_INDICES
Definition: ntgdityp.h:205
#define GCW_WIN32
Definition: ntgdityp.h:203
uint16_t * PWCHAR
Definition: typedefs.h:54
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
static LPCSTR INT LPWORD pgi
Definition: font.c:51
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:417
HDC hdc
Definition: main.c:9
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharWidthW(_In_ HDC hdc, _In_ UINT wcFirst, _In_ UINT cwc, _In_reads_opt_(cwc) PWCHAR pwc, _In_ FLONG fl, _Out_writes_bytes_(cwc *sizeof(ULONG)) PVOID pvBuf)
#define MAXUSHORT
Definition: typedefs.h:81

Referenced by test_GetCharWidthI().

◆ GetCharWidthW()

BOOL WINAPI GetCharWidthW ( HDC  hdc,
UINT  iFirstChar,
UINT  iLastChar,
LPINT  lpBuffer 
)

Definition at line 736 of file font.c.

740 {
741  DPRINT("GetCharWidthsW\n");
742  if ((!lpBuffer) || (iFirstChar > iLastChar))
743  {
745  return FALSE;
746  }
747  return NtGdiGetCharWidthW( hdc,
748  iFirstChar,
749  (ULONG)(iLastChar - iFirstChar + 1),
750  (PWCHAR) NULL,
751  GCW_NOFLOAT,
752  (PVOID) lpBuffer);
753 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define GCW_NOFLOAT
Definition: ntgdityp.h:204
uint16_t * PWCHAR
Definition: typedefs.h:54
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:417
HDC hdc
Definition: main.c:9
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetCharWidthW(_In_ HDC hdc, _In_ UINT wcFirst, _In_ UINT cwc, _In_reads_opt_(cwc) PWCHAR pwc, _In_ FLONG fl, _Out_writes_bytes_(cwc *sizeof(ULONG)) PVOID pvBuf)
unsigned int ULONG
Definition: retypes.h:1

◆ GetEUDCTimeStamp()

ULONG WINAPI GetEUDCTimeStamp ( VOID  )

Definition at line 2582 of file font.c.

2583 {
2584  return NtGdiGetEudcTimeStampEx(NULL,0,TRUE);
2585 }
#define TRUE
Definition: types.h:120
__kernel_entry W32KAPI ULONG APIENTRY NtGdiGetEudcTimeStampEx(_In_reads_opt_(cwcBaseFaceName) LPWSTR lpBaseFaceName, _In_ ULONG cwcBaseFaceName, _In_ BOOL bSystemTimeStamp)
smooth NULL
Definition: ftsmooth.c:416

◆ GetEUDCTimeStampExW()

DWORD WINAPI GetEUDCTimeStampExW ( LPWSTR  lpBaseFaceName)

Definition at line 2592 of file font.c.

2593 {
2594  DWORD retValue = 0;
2595 
2596  if (!lpBaseFaceName)
2597  {
2598  retValue = NtGdiGetEudcTimeStampEx(NULL,0,FALSE);
2599  }
2600  else
2601  {
2602  retValue = NtGdiGetEudcTimeStampEx(lpBaseFaceName, wcslen(lpBaseFaceName), FALSE);
2603  }
2604 
2605  return retValue;
2606 }
__kernel_entry W32KAPI ULONG APIENTRY NtGdiGetEudcTimeStampEx(_In_reads_opt_(cwcBaseFaceName) LPWSTR lpBaseFaceName, _In_ ULONG cwcBaseFaceName, _In_ BOOL bSystemTimeStamp)
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

◆ GetFontAssocStatus()

ULONG WINAPI GetFontAssocStatus ( HDC  hdc)

Definition at line 2613 of file font.c.

2614 {
2615  ULONG retValue = 0;
2616 
2617  if (hdc)
2618  {
2619  retValue = NtGdiQueryFontAssocInfo(hdc);
2620  }
2621 
2622  return retValue;
2623 }
__kernel_entry W32KAPI ULONG APIENTRY NtGdiQueryFontAssocInfo(_In_ HDC hdc)
HDC hdc
Definition: main.c:9
unsigned int ULONG
Definition: retypes.h:1

◆ GetFontData()

DWORD WINAPI GetFontData ( HDC  hdc,
DWORD  dwTable,
DWORD  dwOffset,
LPVOID  lpvBuffer,
DWORD  cbData 
)

Definition at line 2654 of file font.c.

2659 {
2660  if (!lpvBuffer)
2661  {
2662  cbData = 0;
2663  }
2664  return NtGdiGetFontData(hdc, dwTable, dwOffset, lpvBuffer, cbData);
2665 }
_In_ DWORD dwTable
Definition: ntgdi.h:2032
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2032
HDC hdc
Definition: main.c:9
DWORD APIENTRY NtGdiGetFontData(HDC hDC, DWORD Table, DWORD Offset, LPVOID Buffer, DWORD Size)
Definition: font.c:588

Referenced by check_vertical_metrics(), get_first_last_from_cmap(), get_font_metrics(), get_ttf_nametable_entry(), init_script_cache(), load_CMAP_format12_table(), load_gdef_table(), load_gpos_table(), load_gsub_table(), test_fullname2_helper(), and test_text_metrics().

◆ GetFontLanguageInfo()

DWORD WINAPI GetFontLanguageInfo ( HDC  hDc)

Definition at line 1061 of file font.c.

1064 {
1065  DWORD Gcp = 0, Ret = 0;
1066  if (gbLpk)
1067  {
1068  Ret = NtGdiGetTextCharsetInfo(hDc, NULL, 0);
1069  if ((Ret == ARABIC_CHARSET) || (Ret == HEBREW_CHARSET))
1071  }
1073  if ( Gcp == GCP_ERROR)
1074  return Gcp;
1075  else
1076  Ret = Gcp | Ret;
1077  return Ret;
1078 }
#define GCP_ERROR
Definition: wingdi.h:828
__kernel_entry W32KAPI INT APIENTRY NtGdiGetTextCharsetInfo(_In_ HDC hdc, _Out_opt_ LPFONTSIGNATURE lpSig, _In_ DWORD dwFlags)
smooth NULL
Definition: ftsmooth.c:416
#define GCP_DIACRITIC
Definition: wingdi.h:830
#define GCP_LIGATE
Definition: wingdi.h:836
#define GCP_KASHIDA
Definition: wingdi.h:835
DWORD WINAPI GetDCDWord(_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwError)
Definition: dc.c:763
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GCP_GLYPHSHAPE
Definition: wingdi.h:832
#define HEBREW_CHARSET
Definition: wingdi.h:392
#define ARABIC_CHARSET
Definition: wingdi.h:393
#define GCP_REORDER
Definition: wingdi.h:842
BOOL gbLpk
Definition: dllmain.c:11

◆ GetGlyphIndicesA()

DWORD WINAPI GetGlyphIndicesA ( HDC  hdc,
LPCSTR  lpstr,
INT  count,
LPWORD  pgi,
DWORD  flags 
)

Definition at line 1085 of file font.c.

1092 {
1093  DWORD Ret;
1094  WCHAR *lpstrW;
1095  INT countW;
1096 
1097  lpstrW = FONT_mbtowc(hdc, lpstr, count, &countW, NULL);
1098 
1099  if (lpstrW == NULL)
1100  return GDI_ERROR;
1101 
1102  Ret = NtGdiGetGlyphIndicesW(hdc, lpstrW, countW, pgi, flags);
1103  HeapFree(GetProcessHeap(), 0, lpstrW);
1104  return Ret;
1105 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
__kernel_entry W32KAPI DWORD APIENTRY NtGdiGetGlyphIndicesW(_In_ HDC hdc, _In_reads_opt_(cwc) LPCWSTR pwc, _In_ INT cwc, _Out_writes_opt_(cwc) LPWORD pgi, _In_ DWORD iMode)
Definition: freetype.c:7300
int32_t INT
Definition: typedefs.h:56
static LPCSTR INT LPWORD pgi
Definition: font.c:51
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
HDC hdc
Definition: main.c:9
static LPCSTR lpstr
Definition: font.c:51
static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
Definition: font.c:124
#define GDI_ERROR
Definition: wingdi.h:1308
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by test_GetCharWidthI().

◆ GetGlyphOutlineA()

DWORD WINAPI GetGlyphOutlineA ( HDC  hdc,
UINT  uChar,
UINT  uFormat,
LPGLYPHMETRICS  lpgm,
DWORD  cbBuffer,
LPVOID  lpvBuffer,
CONST MAT2 lpmat2 
)

Definition at line 1112 of file font.c.

1121 {
1122 
1123  LPWSTR p = NULL;
1124  DWORD ret;
1125  UINT c;
1126  DPRINT("GetGlyphOutlineA uChar %x\n", uChar);
1127  if (!lpgm || !lpmat2) return GDI_ERROR;
1128  if(!(uFormat & GGO_GLYPH_INDEX))
1129  {
1130  int len;
1131  char mbchs[2];
1132  if(uChar > 0xff) /* but, 2 bytes character only */
1133  {
1134  len = 2;
1135  mbchs[0] = (uChar & 0xff00) >> 8;
1136  mbchs[1] = (uChar & 0xff);
1137  }
1138  else
1139  {
1140  len = 1;
1141  mbchs[0] = (uChar & 0xff);
1142  }
1143  p = FONT_mbtowc(hdc, mbchs, len, NULL, NULL);
1144  if(!p)
1145  return GDI_ERROR;
1146  c = p[0];
1147  }
1148  else
1149  c = uChar;
1150  ret = NtGdiGetGlyphOutline(hdc, c, uFormat, lpgm, cbBuffer, lpvBuffer, (CONST LPMAT2)lpmat2, TRUE);
1151  HeapFree(GetProcessHeap(), 0, p);
1152  return ret;
1153 }
#define TRUE
Definition: types.h:120
Definition: wingdi.h:2467
smooth NULL
Definition: ftsmooth.c:416
ULONG APIENTRY NtGdiGetGlyphOutline(IN HDC hdc, IN WCHAR wch, IN UINT iFormat, OUT LPGLYPHMETRICS pgm, IN ULONG cjBuf, OUT OPTIONAL PVOID UnsafeBuf, IN LPMAT2 pmat2, IN BOOL bIgnoreRotation)
Definition: font.c:721
void DPRINT(...)
Definition: polytest.cpp:61
#define GetProcessHeap()
Definition: compat.h:403
const GLubyte * c
Definition: glext.h:8905
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define GGO_GLYPH_INDEX
Definition: wingdi.h:854
HDC hdc
Definition: main.c:9
GLenum GLsizei len
Definition: glext.h:6722
unsigned int UINT
Definition: ndis.h:50
#define c
Definition: ke_i.h:80
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
Definition: font.c:124
#define GDI_ERROR
Definition: wingdi.h:1308
#define HeapFree(x, y, z)
Definition: compat.h:402
#define CONST
Definition: pedump.c:81

Referenced by test_bitmap_font_metrics(), test_fake_bold_font(), test_GetCharABCWidths(), test_GetGlyphOutline(), test_GetGlyphOutline_metric_clipping(), test_negative_width(), and test_outline_font().

◆ GetGlyphOutlineW()

DWORD WINAPI GetGlyphOutlineW ( HDC  hdc,
UINT  uChar,
UINT  uFormat,
LPGLYPHMETRICS  lpgm,
DWORD  cbBuffer,
LPVOID  lpvBuffer,
CONST MAT2 lpmat2 
)

Definition at line 1161 of file font.c.

1170 {
1171  DPRINT("GetGlyphOutlineW uChar %x\n", uChar);
1172  if (!lpgm || !lpmat2) return GDI_ERROR;
1173  if (!lpvBuffer) cbBuffer = 0;
1174  return NtGdiGetGlyphOutline ( hdc, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, (CONST LPMAT2)lpmat2, TRUE);
1175 }
#define TRUE
Definition: types.h:120
Definition: wingdi.h:2467
ULONG APIENTRY NtGdiGetGlyphOutline(IN HDC hdc, IN WCHAR wch, IN UINT iFormat, OUT LPGLYPHMETRICS pgm, IN ULONG cjBuf, OUT OPTIONAL PVOID UnsafeBuf, IN LPMAT2 pmat2, IN BOOL bIgnoreRotation)
Definition: font.c:721
void DPRINT(...)
Definition: polytest.cpp:61
HDC hdc
Definition: main.c:9
#define GDI_ERROR
Definition: wingdi.h:1308
#define CONST
Definition: pedump.c:81

Referenced by check_vertical_font(), check_vertical_metrics(), test_GetGlyphOutline(), and test_GetGlyphOutline_empty_contour().

◆ GetGlyphOutlineWow()

DWORD WINAPI GetGlyphOutlineWow ( DWORD  a0,
DWORD  a1,
DWORD  a2,
DWORD  a3,
DWORD  a4,
DWORD  a5,
DWORD  a6 
)

Definition at line 1182 of file font.c.

1191 {
1192  UNIMPLEMENTED;
1194  return 0;
1195 }
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define UNIMPLEMENTED
Definition: debug.h:114

◆ GetKerningPairsA()

DWORD WINAPI GetKerningPairsA ( HDC  hDC,
DWORD  cPairs,
LPKERNINGPAIR  kern_pairA 
)

Definition at line 1575 of file font.c.

1578 {
1579  INT charset;
1580  CHARSETINFO csi;
1581  CPINFO cpi;
1582  DWORD i, total_kern_pairs, kern_pairs_copied = 0;
1583  KERNINGPAIR *kern_pairW;
1584 
1585  if (!cPairs && kern_pairA)
1586  {
1588  return 0;
1589  }
1590 
1593  {
1594  DPRINT1("Can't find codepage for charset %d\n", charset);
1595  return 0;
1596  }
1597  /* GetCPInfo() will fail on CP_SYMBOL, and WideCharToMultiByte is supposed
1598  * to fail on an invalid character for CP_SYMBOL.
1599  */
1600  cpi.DefaultChar[0] = 0;
1601  if (csi.ciACP != CP_SYMBOL && !GetCPInfo(csi.ciACP, &cpi))
1602  {
1603  DPRINT1("Can't find codepage %u info\n", csi.ciACP);
1604  return 0;
1605  }
1606  DPRINT("charset %d => codepage %u\n", charset, csi.ciACP);
1607 
1608  total_kern_pairs = NtGdiGetKerningPairs(hDC, 0, NULL);
1609  if (!total_kern_pairs) return 0;
1610 
1611  if (!cPairs && !kern_pairA) return total_kern_pairs;
1612 
1613  kern_pairW = HeapAlloc(GetProcessHeap(), 0, total_kern_pairs * sizeof(*kern_pairW));
1614  if (kern_pairW == NULL)
1615  {
1616  return 0;
1617  }
1618  GetKerningPairsW(hDC, total_kern_pairs, kern_pairW);
1619 
1620  for (i = 0; i < total_kern_pairs; i++)
1621  {
1622  char first, second;
1623 
1624  if (!WideCharToMultiByte(csi.ciACP, 0, &kern_pairW[i].wFirst, 1, &first, 1, NULL, NULL))
1625  continue;
1626 
1627  if (!WideCharToMultiByte(csi.ciACP, 0, &kern_pairW[i].wSecond, 1, &second, 1, NULL, NULL))
1628  continue;
1629 
1630  if (first == cpi.DefaultChar[0] || second == cpi.DefaultChar[0])
1631  continue;
1632 
1633  if (kern_pairA)
1634  {
1635  if (kern_pairs_copied >= cPairs) break;
1636 
1637  kern_pairA->wFirst = (BYTE)first;
1638  kern_pairA->wSecond = (BYTE)second;
1639  kern_pairA->iKernAmount = kern_pairW[i].iKernAmount;
1640  kern_pairA++;
1641  }
1642  kern_pairs_copied++;
1643  }
1644 
1645  HeapFree(GetProcessHeap(), 0, kern_pairW);
1646 
1647  return kern_pairs_copied;
1648 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
BOOL WINAPI GetCPInfo(UINT CodePage, LPCPINFO CodePageInfo)
Definition: nls.c:1920
#define ULongToPtr(ul)
Definition: basetsd.h:92
DWORD APIENTRY NtGdiGetKerningPairs(HDC hDC, ULONG NumPairs, LPKERNINGPAIR krnpair)
Definition: font.c:806
CFF_Charset charset
Definition: cffcmap.c:138
#define WideCharToMultiByte
Definition: compat.h:101
WORD wSecond
Definition: wingdi.h:2460
DWORD WINAPI GetKerningPairsW(HDC hdc, ULONG cPairs, LPKERNINGPAIR pkpDst)
Definition: font.c:1555
const GLint * first
Definition: glext.h:5794
static UINT first
Definition: font.c:44
#define CP_SYMBOL
Definition: winnls.h:231
int32_t INT
Definition: typedefs.h:56
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
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int iKernAmount
Definition: wingdi.h:2461
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
unsigned char BYTE
Definition: mem.h:68
BOOL WINAPI TranslateCharsetInfo(LPDWORD lpSrc, LPCHARSETINFO lpCs, DWORD flags)
Definition: font.c:2186
static HDC hDC
Definition: 3dtext.c:33
BYTE DefaultChar[MAX_DEFAULTCHAR]
Definition: winnls.h:579
#define DPRINT1
Definition: precomp.h:8
int WINAPI GetTextCharset(_In_ HDC)
Definition: text.c:187
#define HeapFree(x, y, z)
Definition: compat.h:402
#define TCI_SRCCHARSET
Definition: wingdi.h:960

◆ GetKerningPairsW()

DWORD WINAPI GetKerningPairsW ( HDC  hdc,
ULONG  cPairs,
LPKERNINGPAIR  pkpDst 
)

Definition at line 1555 of file font.c.

1558 {
1559  if ((cPairs != 0) || (pkpDst == 0))
1560  {
1561  return NtGdiGetKerningPairs(hdc,cPairs,pkpDst);
1562  }
1563  else
1564  {
1566  return 0;
1567  }
1568 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
DWORD APIENTRY NtGdiGetKerningPairs(HDC hDC, ULONG NumPairs, LPKERNINGPAIR krnpair)
Definition: font.c:806
#define SetLastError(x)
Definition: compat.h:417
HDC hdc
Definition: main.c:9

Referenced by GetKerningPairsA(), and test_GetKerningPairs().

◆ GetOutlineTextMetricsA()

UINT APIENTRY GetOutlineTextMetricsA ( HDC  hdc,
UINT  cbData,
LPOUTLINETEXTMETRICA  lpOTM 
)

Definition at line 1202 of file font.c.

1207 {
1208  char buf[512], *ptr;
1209  UINT ret, needed;
1211  OUTLINETEXTMETRICA *output = lpOTM;
1212  INT left, len;
1213 
1214  if((ret = GetOutlineTextMetricsW(hdc, 0, NULL)) == 0)
1215  return 0;
1216  if(ret > sizeof(buf))
1217  {
1218  lpOTMW = HeapAlloc(GetProcessHeap(), 0, ret);
1219  if (lpOTMW == NULL)
1220  {
1221  return 0;
1222  }
1223  }
1224  GetOutlineTextMetricsW(hdc, ret, lpOTMW);
1225 
1226  needed = sizeof(OUTLINETEXTMETRICA);
1227  if(lpOTMW->otmpFamilyName)
1228  needed += WideCharToMultiByte(CP_ACP, 0,
1229  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFamilyName), -1,
1230  NULL, 0, NULL, NULL);
1231  if(lpOTMW->otmpFaceName)
1232  needed += WideCharToMultiByte(CP_ACP, 0,
1233  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFaceName), -1,
1234  NULL, 0, NULL, NULL);
1235  if(lpOTMW->otmpStyleName)
1236  needed += WideCharToMultiByte(CP_ACP, 0,
1237  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpStyleName), -1,
1238  NULL, 0, NULL, NULL);
1239  if(lpOTMW->otmpFullName)
1240  needed += WideCharToMultiByte(CP_ACP, 0,
1241  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFullName), -1,
1242  NULL, 0, NULL, NULL);
1243 
1244  if(!lpOTM)
1245  {
1246  ret = needed;
1247  goto end;
1248  }
1249 
1250  DPRINT("needed = %u\n", needed);
1251  if(needed > cbData)
1252  {
1253  /* Since the supplied buffer isn't big enough, we'll alloc one
1254  that is and memcpy the first cbData bytes into the lpOTM at
1255  the end. */
1256  output = HeapAlloc(GetProcessHeap(), 0, needed);
1257  if (output == NULL)
1258  {
1259  goto end;
1260  }
1261  }
1262 
1263  ret = output->otmSize = min(needed, cbData);
1264  FONT_TextMetricWToA( &lpOTMW->otmTextMetrics, &output->otmTextMetrics );
1265  output->otmFiller = 0;
1266  output->otmPanoseNumber = lpOTMW->otmPanoseNumber;
1267  output->otmfsSelection = lpOTMW->otmfsSelection;
1268  output->otmfsType = lpOTMW->otmfsType;
1269  output->otmsCharSlopeRise = lpOTMW->otmsCharSlopeRise;
1270  output->otmsCharSlopeRun = lpOTMW->otmsCharSlopeRun;
1271  output->otmItalicAngle = lpOTMW->otmItalicAngle;
1272  output->otmEMSquare = lpOTMW->otmEMSquare;
1273  output->otmAscent = lpOTMW->otmAscent;
1274  output->otmDescent = lpOTMW->otmDescent;
1275  output->otmLineGap = lpOTMW->otmLineGap;
1276  output->otmsCapEmHeight = lpOTMW->otmsCapEmHeight;
1277  output->otmsXHeight = lpOTMW->otmsXHeight;
1278  output->otmrcFontBox = lpOTMW->otmrcFontBox;
1279  output->otmMacAscent = lpOTMW->otmMacAscent;
1280  output->otmMacDescent = lpOTMW->otmMacDescent;
1281  output->otmMacLineGap = lpOTMW->otmMacLineGap;
1282  output->otmusMinimumPPEM = lpOTMW->otmusMinimumPPEM;
1283  output->otmptSubscriptSize = lpOTMW->otmptSubscriptSize;
1284  output->otmptSubscriptOffset = lpOTMW->otmptSubscriptOffset;
1285  output->otmptSuperscriptSize = lpOTMW->otmptSuperscriptSize;
1286  output->otmptSuperscriptOffset = lpOTMW->otmptSuperscriptOffset;
1287  output->otmsStrikeoutSize = lpOTMW->otmsStrikeoutSize;
1288  output->otmsStrikeoutPosition = lpOTMW->otmsStrikeoutPosition;
1289  output->otmsUnderscoreSize = lpOTMW->otmsUnderscoreSize;
1290  output->otmsUnderscorePosition = lpOTMW->otmsUnderscorePosition;
1291 
1292 
1293  ptr = (char*)(output + 1);
1294  left = needed - sizeof(*output);
1295 
1296  if(lpOTMW->otmpFamilyName)
1297  {
1298  output->otmpFamilyName = (LPSTR)(ptr - (char*)output);
1300  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFamilyName), -1,
1301  ptr, left, NULL, NULL);
1302  left -= len;
1303  ptr += len;
1304  }
1305  else
1306  output->otmpFamilyName = 0;
1307 
1308  if(lpOTMW->otmpFaceName)
1309  {
1310  output->otmpFaceName = (LPSTR)(ptr - (char*)output);
1312  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFaceName), -1,
1313  ptr, left, NULL, NULL);
1314  left -= len;
1315  ptr += len;
1316  }
1317  else
1318  output->otmpFaceName = 0;
1319 
1320  if(lpOTMW->otmpStyleName)
1321  {
1322  output->otmpStyleName = (LPSTR)(ptr - (char*)output);
1324  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpStyleName), -1,
1325  ptr, left, NULL, NULL);
1326  left -= len;
1327  ptr += len;
1328  }
1329  else
1330  output->otmpStyleName = 0;
1331 
1332  if(lpOTMW->otmpFullName)
1333  {
1334  output->otmpFullName = (LPSTR)(ptr - (char*)output);
1336  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFullName), -1,
1337  ptr, left, NULL, NULL);
1338  left -= len;
1339  }
1340  else
1341  output->otmpFullName = 0;
1342 
1343  ASSERT(left == 0);
1344 
1345  if(output != lpOTM)
1346  {
1347  memcpy(lpOTM, output, cbData);
1349 
1350  /* check if the string offsets really fit into the provided size */
1351  /* FIXME: should we check string length as well? */
1352  if ((UINT_PTR)lpOTM->otmpFamilyName >= lpOTM->otmSize)
1353  lpOTM->otmpFamilyName = 0; /* doesn't fit */
1354 
1355  if ((UINT_PTR)lpOTM->otmpFaceName >= lpOTM->otmSize)
1356  lpOTM->otmpFaceName = 0; /* doesn't fit */
1357 
1358  if ((UINT_PTR)lpOTM->otmpStyleName >= lpOTM->otmSize)
1359  lpOTM->otmpStyleName = 0; /* doesn't fit */
1360 
1361  if ((UINT_PTR)lpOTM->otmpFullName >= lpOTM->otmSize)
1362  lpOTM->otmpFullName = 0; /* doesn't fit */
1363  }
1364 
1365 end:
1366  if(lpOTMW != (OUTLINETEXTMETRICW *)buf)
1367  HeapFree(GetProcessHeap(), 0, lpOTMW);
1368 
1369  return ret;
1370 }
VOID FASTCALL FONT_TextMetricWToA(const TEXTMETRICW *ptmW, LPTEXTMETRICA ptmA)
Definition: font.c:79
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
UINT otmsStrikeoutSize
Definition: wingdi.h:2532
#define WideCharToMultiByte
Definition: compat.h:101
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
POINT otmptSubscriptSize
Definition: wingdi.h:2528
UINT APIENTRY GetOutlineTextMetricsW(HDC hdc, UINT cbData, LPOUTLINETEXTMETRICW lpOTM)
Definition: font.c:1401
GLuint GLuint end
Definition: gl.h:1545
int otmsUnderscorePosition
Definition: wingdi.h:2535
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
static PVOID ptr
Definition: dispmode.c:27
POINT otmptSubscriptOffset
Definition: wingdi.h:2529
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
POINT otmptSuperscriptSize
Definition: wingdi.h:2530
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int intptr_t
Definition: crtdefs.h:283
__wchar_t WCHAR
Definition: xmlstorage.h:180
struct _OUTLINETEXTMETRICA OUTLINETEXTMETRICA
GLint left
Definition: glext.h:7726
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
int otmsStrikeoutPosition
Definition: wingdi.h:2533
int ret
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
TEXTMETRICW otmTextMetrics
Definition: wingdi.h:2509
POINT otmptSuperscriptOffset
Definition: wingdi.h:2531
PANOSE otmPanoseNumber
Definition: wingdi.h:2511
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by check_vertical_metrics(), get_font_fsselection(), test_font_metrics(), test_fstype_fixup(), test_fullname2_helper(), test_GetOutlineTextMetrics(), and test_outline_font().

◆ GetOutlineTextMetricsW()

UINT APIENTRY GetOutlineTextMetricsW ( HDC  hdc,
UINT  cbData,
LPOUTLINETEXTMETRICW  lpOTM 
)

Definition at line 1401 of file font.c.

1406 {
1407  TMDIFF Tmd; // Should not be zero.
1408  UINT Size, AvailableSize = 0, StringSize;
1409  XFORM DevToWorld;
1410  OUTLINETEXTMETRICW* LocalOTM;
1411  WCHAR* Str;
1412  BYTE* Ptr;
1413 
1414  /* Get the structure */
1416  if (!Size)
1417  return 0;
1418  if (!lpOTM || (cbData < sizeof(*lpOTM)))
1419  return Size;
1420 
1421  LocalOTM = HeapAlloc(GetProcessHeap(), 0, Size);
1422  LocalOTM->otmSize = Size;
1423  Size = NtGdiGetOutlineTextMetricsInternalW(hdc, Size, LocalOTM, &Tmd);
1424  if (!Size)
1425  {
1426  HeapFree(GetProcessHeap(), 0, LocalOTM);
1427  return 0;
1428  }
1429 
1430  if (!NtGdiGetTransform(hdc, GdiDeviceSpaceToWorldSpace, &DevToWorld))
1431  {
1432  DPRINT1("NtGdiGetTransform failed!\n");
1433  HeapFree(GetProcessHeap(), 0, LocalOTM);
1435  return 0;
1436  }
1437 
1438  /* Fill in DC specific data */
1441  LocalOTM->otmTextMetrics.tmHeight = height_to_LP( &DevToWorld, LocalOTM->otmTextMetrics.tmHeight );
1442  LocalOTM->otmTextMetrics.tmAscent = height_to_LP( &DevToWorld, LocalOTM->otmTextMetrics.tmAscent );
1443  LocalOTM->otmTextMetrics.tmDescent = height_to_LP( &DevToWorld, LocalOTM->otmTextMetrics.tmDescent );
1444  LocalOTM->otmTextMetrics.tmInternalLeading = height_to_LP( &DevToWorld, LocalOTM->otmTextMetrics.tmInternalLeading );
1445  LocalOTM->otmTextMetrics.tmExternalLeading = height_to_LP( &DevToWorld, LocalOTM->otmTextMetrics.tmExternalLeading );
1446  LocalOTM->otmTextMetrics.tmAveCharWidth = width_to_LP( &DevToWorld, LocalOTM->otmTextMetrics.tmAveCharWidth );
1447  LocalOTM->otmTextMetrics.tmMaxCharWidth = width_to_LP( &DevToWorld, LocalOTM->otmTextMetrics.tmMaxCharWidth );
1448  LocalOTM->otmTextMetrics.tmOverhang = width_to_LP( &DevToWorld, LocalOTM->otmTextMetrics.tmOverhang );
1449  LocalOTM->otmAscent = height_to_LP( &DevToWorld, LocalOTM->otmAscent);
1450  LocalOTM->otmDescent = height_to_LP( &DevToWorld, LocalOTM->otmDescent);
1451  LocalOTM->otmLineGap = abs(INTERNAL_YDSTOWS(&DevToWorld,LocalOTM->otmLineGap));
1452  LocalOTM->otmsCapEmHeight = abs(INTERNAL_YDSTOWS(&DevToWorld,LocalOTM->otmsCapEmHeight));
1453  LocalOTM->otmsXHeight = abs(INTERNAL_YDSTOWS(&DevToWorld,LocalOTM->otmsXHeight));
1454  LocalOTM->otmrcFontBox.top = height_to_LP( &DevToWorld, LocalOTM->otmrcFontBox.top);
1455  LocalOTM->otmrcFontBox.bottom = height_to_LP( &DevToWorld, LocalOTM->otmrcFontBox.bottom);
1456  LocalOTM->otmrcFontBox.left = width_to_LP( &DevToWorld, LocalOTM->otmrcFontBox.left);
1457  LocalOTM->otmrcFontBox.right = width_to_LP( &DevToWorld, LocalOTM->otmrcFontBox.right);
1458  LocalOTM->otmMacAscent = height_to_LP( &DevToWorld, LocalOTM->otmMacAscent);
1459  LocalOTM->otmMacDescent = height_to_LP( &DevToWorld, LocalOTM->otmMacDescent);
1460  LocalOTM->otmMacLineGap = abs(INTERNAL_YDSTOWS(&DevToWorld,LocalOTM->otmMacLineGap));
1461  LocalOTM->otmptSubscriptSize.x = width_to_LP( &DevToWorld, LocalOTM->otmptSubscriptSize.x);
1462  LocalOTM->otmptSubscriptSize.y = height_to_LP( &DevToWorld, LocalOTM->otmptSubscriptSize.y);
1463  LocalOTM->otmptSubscriptOffset.x = width_to_LP( &DevToWorld, LocalOTM->otmptSubscriptOffset.x);
1464  LocalOTM->otmptSubscriptOffset.y = height_to_LP( &DevToWorld, LocalOTM->otmptSubscriptOffset.y);
1465  LocalOTM->otmptSuperscriptSize.x = width_to_LP( &DevToWorld, LocalOTM->otmptSuperscriptSize.x);
1466  LocalOTM->otmptSuperscriptSize.y = height_to_LP( &DevToWorld, LocalOTM->otmptSuperscriptSize.y);
1467  LocalOTM->otmptSuperscriptOffset.x = width_to_LP( &DevToWorld, LocalOTM->otmptSuperscriptOffset.x);
1468  LocalOTM->otmptSuperscriptOffset.y = height_to_LP( &DevToWorld, LocalOTM->otmptSuperscriptOffset.y);
1469  LocalOTM->otmsStrikeoutSize = abs(INTERNAL_YDSTOWS(&DevToWorld,LocalOTM->otmsStrikeoutSize));
1470  LocalOTM->otmsStrikeoutPosition = height_to_LP( &DevToWorld, LocalOTM->otmsStrikeoutPosition);
1471  LocalOTM->otmsUnderscoreSize = height_to_LP( &DevToWorld, LocalOTM->otmsUnderscoreSize);
1472  LocalOTM->otmsUnderscorePosition = height_to_LP( &DevToWorld, LocalOTM->otmsUnderscorePosition);
1473 
1474  /* Copy what we can */
1475  CopyMemory(lpOTM, LocalOTM, min(Size, cbData));
1476 
1477  lpOTM->otmpFamilyName = NULL;
1478  lpOTM->otmpFaceName = NULL;
1479  lpOTM->otmpStyleName = NULL;
1480  lpOTM->otmpFullName = NULL;
1481 
1482  Size = sizeof(*lpOTM);
1483  AvailableSize = cbData - Size;
1484  Ptr = (BYTE*)lpOTM + sizeof(*lpOTM);
1485 
1486  /* Fix string values up */
1487  if (LocalOTM->otmpFamilyName)
1488  {
1489  Str = (WCHAR*)((char*)LocalOTM + (ptrdiff_t)LocalOTM->otmpFamilyName);
1490  StringSize = (wcslen(Str) + 1) * sizeof(WCHAR);
1491  if (AvailableSize >= StringSize)
1492  {
1493  CopyMemory(Ptr, Str, StringSize);
1494  lpOTM->otmpFamilyName = (PSTR)(Ptr - (BYTE*)lpOTM);
1495  Ptr += StringSize;
1496  AvailableSize -= StringSize;
1497  Size += StringSize;
1498  }
1499  }
1500 
1501  if (LocalOTM->otmpFaceName)
1502  {
1503  Str = (WCHAR*)((char*)LocalOTM + (ptrdiff_t)LocalOTM->otmpFaceName);
1504  StringSize = (wcslen(Str) + 1) * sizeof(WCHAR);
1505  if (AvailableSize >= StringSize)
1506  {
1507  CopyMemory(Ptr, Str, StringSize);
1508  lpOTM->otmpFaceName = (PSTR)(Ptr - (BYTE*)lpOTM);
1509  Ptr += StringSize;
1510  AvailableSize -= StringSize;
1511  Size += StringSize;
1512  }
1513  }
1514 
1515  if (LocalOTM->otmpStyleName)
1516  {
1517  Str = (WCHAR*)((char*)LocalOTM + (ptrdiff_t)LocalOTM->otmpStyleName);
1518  StringSize = (wcslen(Str) + 1) * sizeof(WCHAR);
1519  if (AvailableSize >= StringSize)
1520  {
1521  CopyMemory(Ptr, Str, StringSize);
1522  lpOTM->otmpStyleName = (PSTR)(Ptr - (BYTE*)lpOTM);
1523  Ptr += StringSize;
1524  AvailableSize -= StringSize;
1525  Size += StringSize;
1526  }
1527  }
1528 
1529  if (LocalOTM->otmpFullName)
1530  {
1531  Str = (WCHAR*)((char*)LocalOTM + (ptrdiff_t)LocalOTM->otmpFullName);
1532  StringSize = (wcslen(Str) + 1) * sizeof(WCHAR);
1533  if (AvailableSize >= StringSize)
1534  {
1535  CopyMemory(Ptr, Str, StringSize);
1536  lpOTM->otmpFullName = (PSTR)(Ptr - (BYTE*)lpOTM);
1537  Ptr += StringSize;
1538  AvailableSize -= StringSize;
1539  Size += StringSize;
1540  }
1541  }
1542 
1543  lpOTM->otmSize = Size;
1544 
1545  HeapFree(GetProcessHeap(), 0, LocalOTM);
1546 
1547  return Size;
1548 }
LONG tmMaxCharWidth
Definition: wingdi.h:2384
#define abs(i)
Definition: fconv.c:206
#define LOGPIXELSX
Definition: wingdi.h:717
UINT otmsStrikeoutSize
Definition: wingdi.h:2532
long y
Definition: polytest.cpp:48
LONG tmExternalLeading
Definition: wingdi.h:2382
long x
Definition: polytest.cpp:48
POINT otmptSubscriptSize
Definition: wingdi.h:2528
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
LONG tmAveCharWidth
Definition: wingdi.h:2383
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define GdiDeviceSpaceToWorldSpace
Definition: ntgdityp.h:184
LONG top
Definition: windef.h:292
static INT width_to_LP(XFORM *xForm, INT width)
Definition: font.c:1386
LONG left
Definition: windef.h:291
ULONG APIENTRY NtGdiGetOutlineTextMetricsInternalW(HDC hDC, ULONG Data, OUTLINETEXTMETRICW *otm, TMDIFF *Tmd)
Definition: font.c:880
LONG tmDescent
Definition: wingdi.h:2380
LONG tmAscent
Definition: wingdi.h:2379
LONG tmInternalLeading
Definition: wingdi.h:2381
int otmsUnderscorePosition
Definition: wingdi.h:2535
LONG right
Definition: windef.h:293
static INT INTERNAL_YDSTOWS(XFORM *xForm, INT height)
Definition: font.c:1375
BOOL APIENTRY NtGdiGetTransform(_In_ HDC hdc, _In_ DWORD iXform, _Out_ LPXFORM pxf)
POINT otmptSubscriptOffset
Definition: wingdi.h:2529
smooth NULL
Definition: ftsmooth.c:416
POINT otmptSuperscriptSize
Definition: wingdi.h:2530
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CopyMemory
Definition: winbase.h:1640
LONG tmOverhang
Definition: wingdi.h:2386
#define SetLastError(x)
Definition: compat.h:417
int otmsStrikeoutPosition
Definition: wingdi.h:2533
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
unsigned char BYTE
Definition: mem.h:68
LONG tmDigitizedAspectY
Definition: wingdi.h:2388
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
static INT height_to_LP(XFORM *xForm, INT height)
Definition: font.c:1391
signed char * PSTR
Definition: retypes.h:7
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
TEXTMETRICW otmTextMetrics
Definition: wingdi.h:2509
#define DPRINT1
Definition: precomp.h:8
POINT otmptSuperscriptOffset
Definition: wingdi.h:2531
LONG bottom
Definition: windef.h:294
#define LOGPIXELSY
Definition: wingdi.h:718
LONG tmHeight
Definition: wingdi.h:2378
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:402
LONG tmDigitizedAspectX
Definition: wingdi.h:2387

Referenced by gdi_get_font_metrics(), GdipCreateFont(), GdipCreateFontFromLogfontW(), get_font_metrics(), GetOutlineTextMetricsA(), and test_GetKerningPairs().

◆ height_to_LP()

static INT height_to_LP ( XFORM xForm,
INT  height 
)
inlinestatic

Definition at line 1391 of file font.c.

1392 {
1393  return GDI_ROUND( (double)height * fabs( xForm->eM22 ));
1394 }
static __inline INT GDI_ROUND(FLOAT val)
Definition: font.c:22
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
FLOAT eM22
Definition: wingdi.h:1719

Referenced by GetOutlineTextMetricsW().

◆ IntEnumFontFamilies()

static int FASTCALL IntEnumFontFamilies ( HDC  Dc,
const LOGFONTW LogFont,
PVOID  EnumProc,
LPARAM  lParam,
DWORD  dwFlags 
)
static

Definition at line 288 of file font.c.

290 {
291  int FontFamilyCount;
293  int Ret = 1;
294  int i;
295  ENUMLOGFONTEXA EnumLogFontExA;
296  NEWTEXTMETRICEXA NewTextMetricExA;
297  LOGFONTW lfW;
298  LONG InfoCount;
299  ULONG DataSize;
301 
304  if (Info == NULL)
305  {
306  return 1;
307  }
308 
309  /* Initialize the LOGFONT structure */
310  ZeroMemory(&lfW, sizeof(lfW));
311  if (!LogFont)
312  {
314  }
315  else
316  {
317  lfW.lfCharSet = LogFont->lfCharSet;
318  lfW.lfPitchAndFamily = LogFont->lfPitchAndFamily;
319  StringCbCopyW(lfW.lfFaceName, sizeof(lfW.lfFaceName), LogFont->lfFaceName);
320  }
321 
322  /* Retrieve the font information */
323  InfoCount = INITIAL_FAMILY_COUNT;
324  FontFamilyCount = NtGdiGetFontFamilyInfo(Dc, &lfW, Info, &InfoCount);
325  if (FontFamilyCount < 0)
326  {
328  return 1;
329  }
330 
331  /* Resize the buffer if the buffer is too small */
332  if (INITIAL_FAMILY_COUNT < InfoCount)
333  {
335 
336  Status = RtlULongMult(InfoCount, sizeof(FONTFAMILYINFO), &DataSize);
337  if (!NT_SUCCESS(Status) || DataSize > LONG_MAX)
338  {
339  DPRINT1("Overflowed.\n");
340  return 1;
341  }
343  if (Info == NULL)
344  {
345  return 1;
346  }
347  FontFamilyCount = NtGdiGetFontFamilyInfo(Dc, &lfW, Info, &InfoCount);
348  if (FontFamilyCount < 0 || FontFamilyCount < InfoCount)
349  {
351  return 1;
352  }
353  }
354 
355  /* Sort and remove redundant information */
356  qsort(Info, FontFamilyCount, sizeof(*Info), IntFontFamilyCompare);
357  FontFamilyCount = IntFontFamilyListUnique(Info, FontFamilyCount, &lfW, dwFlags);
358 
359  /* call the callback */
360  for (i = 0; i < FontFamilyCount; i++)
361  {
362  if (dwFlags & IEFF_UNICODE)
363  {
364  Ret = ((FONTENUMPROCW) EnumProc)(
365  (VOID*)&Info[i].EnumLogFontEx,
366  (VOID*)&Info[i].NewTextMetricEx,
367  Info[i].FontType, lParam);
368  }
369  else
370  {
371  // Could use EnumLogFontExW2A here?
372  LogFontW2A(&EnumLogFontExA.elfLogFont, &Info[i].EnumLogFontEx.elfLogFont);
373  WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfFullName, -1,
374  (LPSTR)EnumLogFontExA.elfFullName, LF_FULLFACESIZE, NULL, NULL);
375  WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfStyle, -1,
376  (LPSTR)EnumLogFontExA.elfStyle, LF_FACESIZE, NULL, NULL);
377  WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfScript, -1,
378  (LPSTR)EnumLogFontExA.elfScript, LF_FACESIZE, NULL, NULL);
379  NewTextMetricExW2A(&NewTextMetricExA,
380  &Info[i].NewTextMetricEx);
381  Ret = ((FONTENUMPROCA) EnumProc)(
382  (VOID*)&EnumLogFontExA,
383  (VOID*)&NewTextMetricExA,
384  Info[i].FontType, lParam);
385  }
386 
387  if(Ret == 0)
388  break;
389  }
390 
392 
393  return Ret;
394 }
#define LF_FACESIZE
Definition: dimm.idl:39
BYTE lfPitchAndFamily
Definition: dimm.idl:71
#define LF_FULLFACESIZE
Definition: wingdi.h:41
#define WideCharToMultiByte
Definition: compat.h:101
static int __cdecl IntFontFamilyCompare(const void *ffi1, const void *ffi2)
Definition: font.c:245
VOID FASTCALL NewTextMetricExW2A(NEWTEXTMETRICEXA *tma, NEWTEXTMETRICEXW *tmw)
Definition: font.c:201
BYTE elfScript[LF_FACESIZE]
Definition: wingdi.h:2694
LONG NTSTATUS
Definition: precomp.h:26
BYTE lfCharSet
Definition: dimm.idl:67
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define ZeroMemory
Definition: winbase.h:1642
#define INITIAL_FAMILY_COUNT
Definition: font.c:72
FARPROC FONTENUMPROCA
Definition: wingdi.h:2891
char * LPSTR
Definition: xmlstorage.h:182
#define DEFAULT_CHARSET
Definition: wingdi.h:383
BYTE elfFullName[LF_FULLFACESIZE]
Definition: wingdi.h:2692
struct TraceInfo Info
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
long LONG
Definition: pedump.c:60
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
smooth NULL
Definition: ftsmooth.c:416
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
VOID NTAPI LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW)
Definition: utils.c:375
#define GetProcessHeap()
Definition: compat.h:403
#define IEFF_UNICODE
Definition: font.c:251
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define LONG_MAX
Definition: limits.h:43
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
Status
Definition: gdiplustypes.h:24
LONG NTAPI NtGdiGetFontFamilyInfo(HDC Dc, const LOGFONTW *UnsafeLogFont, PFONTFAMILYINFO UnsafeInfo, LPLONG UnsafeInfoCount)
Definition: freetype.c:5918
FARPROC FONTENUMPROCW
Definition: wingdi.h:2892
struct tagFONTFAMILYINFO FONTFAMILYINFO
#define DPRINT1
Definition: precomp.h:8
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
unsigned int ULONG
Definition: retypes.h:1
static BOOL CALLBACK EnumProc(_In_ HWND hWnd, _In_ LPARAM lParam)
Definition: SetParent.c:53
#define CP_THREAD_ACP
Definition: winnls.h:230
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
LPARAM lParam
Definition: combotst.c:139
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
LOGFONTA elfLogFont
Definition: wingdi.h:2691
BYTE elfStyle[LF_FACESIZE]
Definition: wingdi.h:2693
int FASTCALL IntFontFamilyListUnique(FONTFAMILYINFO *InfoList, INT nCount, const LOGFONTW *plf, DWORD dwFlags)
Definition: font.c:255

Referenced by EnumFontFamiliesA(), EnumFontFamiliesExA(), EnumFontFamiliesExW(), and EnumFontFamiliesW().

◆ INTERNAL_YDSTOWS()

static INT INTERNAL_YDSTOWS ( XFORM xForm,
INT  height 
)
inlinestatic

Definition at line 1375 of file font.c.

1376 {
1377  double floatHeight;
1378 
1379  /* Perform operation with floating point */
1380  floatHeight = (double)height * xForm->eM22;
1381  /* Round to integers */
1382  return GDI_ROUND(floatHeight);
1383 }
static __inline INT GDI_ROUND(FLOAT val)
Definition: font.c:22
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
FLOAT eM22
Definition: wingdi.h:1719

Referenced by GetOutlineTextMetricsW().

◆ IntFontFamilyCompare()

static int __cdecl IntFontFamilyCompare ( const void ffi1,
const void ffi2 
)
static

Definition at line 245 of file font.c.

246 {
247  return IntFontFamilyCompareEx(ffi1, ffi2, IFFCX_STYLE | IFFCX_CHARSET);
248 }
FORCEINLINE int FASTCALL IntFontFamilyCompareEx(const FONTFAMILYINFO *ffi1, const FONTFAMILYINFO *ffi2, DWORD dwCompareFlags)
Definition: font.c:212
#define IFFCX_CHARSET
Definition: font.c:208
#define IFFCX_STYLE
Definition: font.c:209

Referenced by IntEnumFontFamilies().

◆ IntFontFamilyCompareEx()

FORCEINLINE int FASTCALL IntFontFamilyCompareEx ( const FONTFAMILYINFO ffi1,
const FONTFAMILYINFO ffi2,
DWORD  dwCompareFlags 
)

Definition at line 212 of file font.c.

214 {
215  const LOGFONTW *plf1 = &ffi1->EnumLogFontEx.elfLogFont;
216  const LOGFONTW *plf2 = &ffi2->EnumLogFontEx.elfLogFont;
217  ULONG WeightDiff1, WeightDiff2;
218  int cmp = _wcsicmp(plf1->lfFaceName, plf2->lfFaceName);
219  if (cmp)
220  return cmp;
221  if (dwCompareFlags & IFFCX_CHARSET)
222  {
223  if (plf1->lfCharSet < plf2->lfCharSet)
224  return -1;
225  if (plf1->lfCharSet > plf2->lfCharSet)
226  return 1;
227  }
228  if (dwCompareFlags & IFFCX_STYLE)
229  {
230  WeightDiff1 = labs(plf1->lfWeight - FW_NORMAL);
231  WeightDiff2 = labs(plf2->lfWeight - FW_NORMAL);
232  if (WeightDiff1 < WeightDiff2)
233  return -1;
234  if (WeightDiff1 > WeightDiff2)
235  return 1;
236  if (plf1->lfItalic < plf2->lfItalic)
237  return -1;
238  if (plf1->lfItalic > plf2->lfItalic)
239  return 1;
240  }
241  return 0;
242 }
BYTE lfCharSet
Definition: dimm.idl:67
#define cmp(status, error)
Definition: error.c:114
#define IFFCX_CHARSET
Definition: font.c:208
ENUMLOGFONTEXW EnumLogFontEx
Definition: ntgdibad.h:47
BYTE lfItalic
Definition: dimm.idl:64
#define FW_NORMAL
Definition: wingdi.h:372
LOGFONTW elfLogFont
Definition: wingdi.h:2697
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
unsigned int ULONG
Definition: retypes.h:1
_Check_return_ long __cdecl labs(_In_ long x)
LONG lfWeight
Definition: dimm.idl:63
#define IFFCX_STYLE
Definition: font.c:209
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by IntFontFamilyCompare(), and IntFontFamilyListUnique().

◆ IntFontFamilyListUnique()

int FASTCALL IntFontFamilyListUnique ( FONTFAMILYINFO InfoList,
INT  nCount,
const LOGFONTW plf,
DWORD  dwFlags 
)

Definition at line 255 of file font.c.

257 {
259  DWORD dwCompareFlags = 0;
260 
261  if (plf->lfFaceName[0])
262  dwCompareFlags |= IFFCX_STYLE;
263 
264  if ((dwFlags & IEFF_EXTENDED) && plf->lfCharSet == DEFAULT_CHARSET)
265  dwCompareFlags |= IFFCX_CHARSET;
266 
267  first = InfoList;
268  last = &InfoList[nCount];
269 
270  /* std::unique(first, last, IntFontFamilyCompareEx); */
271  if (first == last)
272  return 0;
273 
274  result = first;
275  while (++first != last)
276  {
277  if (IntFontFamilyCompareEx(result, first, dwCompareFlags) != 0)
278  {
279  *(++result) = *first;
280  }
281  }
282  nCount = (int)(++result - InfoList);
283 
284  return nCount;
285 }
const GLint * first
Definition: glext.h:5794
BYTE lfCharSet
Definition: dimm.idl:67
static UINT UINT last
Definition: font.c:45
#define DEFAULT_CHARSET
Definition: wingdi.h:383
static UINT first
Definition: font.c:44
FORCEINLINE int FASTCALL IntFontFamilyCompareEx(const FONTFAMILYINFO *ffi1, const FONTFAMILYINFO *ffi2, DWORD dwCompareFlags)
Definition: font.c:212
#define IFFCX_CHARSET
Definition: font.c:208
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IEFF_EXTENDED
Definition: font.c:252
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define IFFCX_STYLE
Definition: font.c:209
GLuint64EXT * result
Definition: glext.h:11304
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by IntEnumFontFamilies().

◆ NewEnumFontFamiliesExW()

INT WINAPI NewEnumFontFamiliesExW ( HDC  hDC,
LPLOGFONTW  lpLogfont,
FONTENUMPROCW  lpEnumFontFamExProcW,
LPARAM  lParam,
DWORD  dwFlags 
)

Definition at line 2326 of file font.c.

2332 {
2333  ULONG_PTR idEnum;
2334  ULONG cbDataSize, cbRetSize;
2335  PENUMFONTDATAW pEfdw;
2336  PBYTE pBuffer;
2337  PBYTE pMax;
2338  INT ret = 1;
2339 
2340  /* Open enumeration handle and find out how much memory we need */
2341  idEnum = NtGdiEnumFontOpen(hDC,
2343  0,
2344  LF_FACESIZE,
2345  (lpLogfont && lpLogfont->lfFaceName[0])? lpLogfont->lfFaceName : NULL,
2346  lpLogfont? lpLogfont->lfCharSet : DEFAULT_CHARSET,
2347  &cbDataSize);
2348  if (idEnum == 0)
2349  {
2350  return 0;
2351  }
2352  if (cbDataSize == 0)
2353  {
2354  NtGdiEnumFontClose(idEnum);
2355  return 0;
2356  }
2357 
2358  /* Allocate memory */
2359  pBuffer = HeapAlloc(GetProcessHeap(), 0, cbDataSize);
2360  if (pBuffer == NULL)
2361  {
2363  NtGdiEnumFontClose(idEnum);
2364  return 0;
2365  }
2366 
2367  /* Do the enumeration */
2368  if (!NtGdiEnumFontChunk(hDC, idEnum, cbDataSize, &cbRetSize, (PVOID)pBuffer))
2369  {
2371  NtGdiEnumFontClose(idEnum);
2372  return 0;
2373  }
2374 
2375  /* Get start and end address */
2376  pEfdw = (PENUMFONTDATAW)pBuffer;
2377  pMax = pBuffer + cbDataSize;
2378 
2379  /* Iterate through the structures */
2380  while ((PBYTE)pEfdw < pMax && ret)
2381  {
2382  PNTMW_INTERNAL pNtmwi = (PNTMW_INTERNAL)((ULONG_PTR)pEfdw + pEfdw->ulNtmwiOffset);
2383 
2384  ret = lpEnumFontFamExProcW((VOID*)&pEfdw->elfexdv.elfEnumLogfontEx,
2385  (VOID*)&pNtmwi->ntmw,
2386  pEfdw->dwFontType,
2387  lParam);
2388 
2389  pEfdw = (PENUMFONTDATAW)((ULONG_PTR)pEfdw + pEfdw->cbSize);
2390  }
2391 
2392  /* Release the memory and close handle */
2394  NtGdiEnumFontClose(idEnum);
2395 
2396  return ret;
2397 }
#define LF_FACESIZE
Definition: dimm.idl:39
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
ULONG ulNtmwiOffset
Definition: ntgdityp.h:382
DWORD dwFontType
Definition: ntgdityp.h:383
#define DEFAULT_CHARSET
Definition: wingdi.h:383
int32_t INT
Definition: typedefs.h:56
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define EfdFontFamilies
Definition: font.c:2322
smooth NULL
Definition: ftsmooth.c:416
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiEnumFontOpen(_In_ HDC hdc, _In_ ULONG iEnumType, _In_ FLONG flWin31Compat, _In_ ULONG cwchMax, _In_opt_ LPWSTR pwszFaceName, _In_ ULONG lfCharSet, _Out_ ULONG *pulCount)
PVOID pBuffer
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiEnumFontClose(_In_ ULONG_PTR idEnum)
#define SetLastError(x)
Definition: compat.h:417
struct _NTMW_INTERNAL * PNTMW_INTERNAL
int ret
ENUMLOGFONTEXDVW elfexdv
Definition: ntgdityp.h:384
BYTE lfCharSet
Definition: wingdi.h:1900
static HDC hDC
Definition: 3dtext.c:33
struct _ENUMFONTDATAW * PENUMFONTDATAW
__kernel_entry W32KAPI BOOL APIENTRY NtGdiEnumFontChunk(_In_ HDC hdc, _In_ ULONG_PTR idEnum, _In_ ULONG cjEfdw, _Out_ ULONG *pcjEfdw, _Out_ PENUMFONTDATAW pefdw)
unsigned int ULONG
Definition: retypes.h:1
ULONG cbSize
Definition: ntgdityp.h:381
ENUMLOGFONTEXW elfEnumLogfontEx
Definition: wingdi.h:2774
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1905
BYTE * PBYTE
Definition: pedump.c:66
LPARAM lParam
Definition: combotst.c:139
#define HeapFree(x, y, z)
Definition: compat.h:402
NEWTEXTMETRICEXW ntmw
Definition: ntgdityp.h:376

◆ NewGetCharacterPlacementW()

DWORD WINAPI NewGetCharacterPlacementW ( HDC  hdc,
LPCWSTR  lpString,
INT  uCount,
INT  nMaxExtent,
GCP_RESULTSW lpResults,
DWORD  dwFlags 
)

Definition at line 641 of file font.c.

649 {
650  ULONG nSet;
651  SIZE Size = {0,0};
652 
653  if ( !lpString || uCount <= 0 || (nMaxExtent < 0 && nMaxExtent != -1 ) )
654  {
656  return 0;
657  }
658 
659  if ( !lpResults )
660  {
661  if ( GetTextExtentPointW(hdc, lpString, uCount, &Size) )
662  {
663  return MAKELONG(Size.cx, Size.cy);
664  }
665  return 0;
666  }
667 
668  nSet = uCount;
669  if ( nSet > lpResults->nGlyphs )
670  nSet = lpResults->nGlyphs;
671 
673  (LPWSTR)lpString,
674  nSet,
675  nMaxExtent,
676  lpResults,
677  dwFlags);
678 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
DWORD APIENTRY NtGdiGetCharacterPlacementW(IN HDC hdc, IN LPWSTR pwsz, IN INT nCount, IN INT nMaxExtent, IN OUT LPGCP_RESULTSW pgcpw, IN DWORD dwFlags)
Definition: font.c:566
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define SetLastError(x)
Definition: compat.h:417
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)

◆ NewTextMetricExW2A()

VOID FASTCALL NewTextMetricExW2A ( NEWTEXTMETRICEXA tma,
NEWTEXTMETRICEXW tmw 
)

Definition at line 201 of file font.c.

202 {
203  NewTextMetricW2A(&tma->ntmTm, &tmw->ntmTm);
204  tma->ntmFontSig = tmw->ntmFontSig;
205 }
VOID FASTCALL NewTextMetricW2A(NEWTEXTMETRICA *tma, NEWTEXTMETRICW *tmw)
Definition: font.c:191
NEWTEXTMETRICA ntmTm
Definition: wingdi.h:2666
NEWTEXTMETRICW ntmTm
Definition: wingdi.h:2670
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2667
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2671

Referenced by IntEnumFontFamilies().

◆ NewTextMetricW2A()

VOID FASTCALL NewTextMetricW2A ( NEWTEXTMETRICA tma,
NEWTEXTMETRICW tmw 
)

Definition at line 191 of file font.c.

192 {
193  FONT_TextMetricWToA((TEXTMETRICW *) tmw, (TEXTMETRICA *) tma);
194  tma->ntmFlags = tmw->ntmFlags;
195  tma->ntmSizeEM = tmw->ntmSizeEM;
196  tma->ntmCellHeight = tmw->ntmCellHeight;
197  tma->ntmAvgWidth = tmw->ntmAvgWidth;
198 }
VOID FASTCALL FONT_TextMetricWToA(const TEXTMETRICW *ptmW, LPTEXTMETRICA ptmA)
Definition: font.c:79
UINT ntmCellHeight
Definition: wingdi.h:2635

Referenced by NewTextMetricExW2A().

◆ QueryFontAssocStatus()

DWORD WINAPI QueryFontAssocStatus ( VOID  )

Definition at line 2630 of file font.c.

2631 {
2632  UNIMPLEMENTED;
2634  return 0;
2635 }
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define UNIMPLEMENTED
Definition: debug.h:114

◆ RemoveFontMemResourceEx()

BOOL WINAPI RemoveFontMemResourceEx ( HANDLE  fh)

Definition at line 2475 of file font.c.

2476 {
2477  if (fh)
2478  {
2479  return NtGdiRemoveFontMemResourceEx(fh);
2480  }
2482  return FALSE;
2483 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define SetLastError(x)
Definition: compat.h:417
BOOL APIENTRY NtGdiRemoveFontMemResourceEx(IN HANDLE hMMFont)
Definition: font.c:554

Referenced by START_TEST().

◆ RemoveFontResourceA()

BOOL WINAPI RemoveFontResourceA ( LPCSTR  lpFileName)

Definition at line 2059 of file font.c.

2060 {
2061  return RemoveFontResourceExA(lpFileName,0,0);
2062 }
BOOL WINAPI RemoveFontResourceExA(LPCSTR lpFileName, DWORD fl, PVOID pdv)
Definition: font.c:2069
_In_ LPCSTR lpFileName
Definition: winbase.h:3018

◆ RemoveFontResourceExA()

BOOL WINAPI RemoveFontResourceExA ( LPCSTR  lpFileName,
DWORD  fl,
PVOID  pdv 
)

Definition at line 2069 of file font.c.

2073 {
2074  NTSTATUS Status;
2075  LPWSTR lpFileNameW;
2076 
2077  /* FIXME the flags */
2078  /* FIXME the pdv */
2079  /* FIXME NtGdiRemoveFontResource handle flags and pdv */
2080 
2081  Status = HEAP_strdupA2W ( &lpFileNameW, lpFileName );
2082  if (!NT_SUCCESS (Status))
2084  else
2085  {
2086 
2087  HEAP_free ( lpFileNameW );
2088  }
2089 
2090  return 0;
2091 }
VOID HEAP_free(LPVOID memory)
Definition: heap.c:63
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS HEAP_strdupA2W(LPWSTR *ppszW, LPCSTR lpszA)
Definition: heap.c:43
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:417
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
_In_ LPCSTR lpFileName
Definition: winbase.h:3018

Referenced by RemoveFontResourceA(), and test_long_names().

◆ RemoveFontResourceExW()

BOOL WINAPI RemoveFontResourceExW ( LPCWSTR  lpFileName,
DWORD  fl,
PVOID  pdv 
)

Definition at line 2098 of file font.c.

2101 {
2102  /* FIXME the flags */
2103  /* FIXME the pdv */
2104  /* FIXME NtGdiRemoveFontResource handle flags and pdv */
2105  DPRINT("RemoveFontResourceExW\n");
2106  return 0;
2107 }
void DPRINT(...)
Definition: polytest.cpp:61

Referenced by RemoveFontResourceW(), and RemoveTempFont().

◆ RemoveFontResourceTracking()

int WINAPI RemoveFontResourceTracking ( LPCSTR  lpString,
int  unknown 
)

Definition at line 2506 of file font.c.

2507 {
2508  UNIMPLEMENTED;
2510  return 0;
2511 }
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define UNIMPLEMENTED
Definition: debug.h:114

◆ RemoveFontResourceW()

BOOL WINAPI RemoveFontResourceW ( LPCWSTR  lpFileName)

Definition at line 2048 of file font.c.

2049 {
2050  return RemoveFontResourceExW(lpFileName,0,0);
2051 }
BOOL WINAPI RemoveFontResourceExW(LPCWSTR lpFileName, DWORD fl, PVOID pdv)
Definition: font.c:2098
_In_ LPCSTR lpFileName
Definition: winbase.h:3018

◆ SetMapperFlags()

DWORD WINAPI SetMapperFlags ( HDC  hDC,
DWORD  flags 
)

Definition at line 2235 of file font.c.

2239 {
2240  DWORD Ret = GDI_ERROR;
2241  PDC_ATTR Dc_Attr;
2242 
2243  /* Get the DC attribute */
2244  Dc_Attr = GdiGetDcAttr(hDC);
2245  if (Dc_Attr == NULL)
2246  {
2248  return GDI_ERROR;
2249  }
2250 
2251  if (NtCurrentTeb()->GdiTebBatch.HDC == hDC)
2252  {
2253  if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
2254  {
2255  NtGdiFlush();
2256  Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
2257  }
2258  }
2259 
2260  if ( flags & ~1 )
2262  else
2263  {
2264  Ret = Dc_Attr->flFontMapper;
2265  Dc_Attr->flFontMapper = flags;
2266  }
2267  return Ret;
2268 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
FLONG flFontMapper
Definition: ntgdihdl.h:320
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
smooth NULL
Definition: ftsmooth.c:416
static LPCSTR INT LPWORD DWORD flags
Definition: font.c:51
ULONG ulDirty_
Definition: ntgdihdl.h:298
__kernel_entry W32KAPI NTSTATUS APIENTRY NtGdiFlu