Commit c23f8578 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Don't enable client side fonts unless we have at least one non-symbol

font installed - this avoids a nasty Wingdings only scenario. Add the ability to perform font replacements, this essentially lets you give a second name to a font family so that familyA gets enumerated as familyB too. If we encounter two copies of the same font then use the one with the larger version number. Dmitry Timoshkov <dmitry@codeweavers.com> Move GetTextCharsetInfo implementation to the font driver.
parent 6fcf4019
......@@ -483,6 +483,7 @@ extern DWORD WineEngGetGlyphOutline(GdiFont, UINT glyph, UINT format,
LPGLYPHMETRICS, DWORD buflen, LPVOID buf,
const MAT2*);
extern UINT WineEngGetOutlineTextMetrics(GdiFont, UINT, LPOUTLINETEXTMETRICW);
extern UINT WineEngGetTextCharsetInfo(GdiFont font, LPFONTSIGNATURE fs, DWORD flags);
extern BOOL WineEngGetTextExtentPoint(GdiFont, LPCWSTR, INT, LPSIZE);
extern BOOL WineEngGetTextExtentPointI(GdiFont, const WORD *, INT, LPSIZE);
extern INT WineEngGetTextFace(GdiFont, INT, LPWSTR);
......
......@@ -2235,3 +2235,33 @@ BOOL WINAPI RemoveFontResourceExW( LPCWSTR str, DWORD fl, PVOID pdv )
{
return WineEngRemoveFontResourceEx(str, fl, pdv);
}
/***********************************************************************
* GetTextCharset (GDI32.@)
*/
UINT WINAPI GetTextCharset(HDC hdc)
{
/* MSDN docs say this is equivalent */
return GetTextCharsetInfo(hdc, NULL, 0);
}
/***********************************************************************
* GetTextCharsetInfo (GDI32.@)
*/
UINT WINAPI GetTextCharsetInfo(HDC hdc, LPFONTSIGNATURE fs, DWORD flags)
{
UINT ret = DEFAULT_CHARSET;
DC *dc = DC_GetDCPtr(hdc);
if (!dc) goto done;
if (dc->gdiFont)
ret = WineEngGetTextCharsetInfo(dc->gdiFont, fs, flags);
GDI_ReleaseObj(hdc);
done:
if (ret == DEFAULT_CHARSET && fs)
memset(fs, 0, sizeof(FONTSIGNATURE));
return ret;
}
......@@ -207,61 +207,6 @@ BOOL WINAPI TextOutW(HDC hdc, INT x, INT y, LPCWSTR str, INT count)
/***********************************************************************
* GetTextCharset [GDI32.@] Gets character set for font in DC
*
* NOTES
* Should it return a UINT32 instead of an INT32?
* => YES, as GetTextCharsetInfo returns UINT32
*
* RETURNS
* Success: Character set identifier
* Failure: DEFAULT_CHARSET
*/
UINT WINAPI GetTextCharset(
HDC hdc) /* [in] Handle to device context */
{
/* MSDN docs say this is equivalent */
return GetTextCharsetInfo(hdc, NULL, 0);
}
/***********************************************************************
* GetTextCharsetInfo [GDI32.@] Gets character set for font
*
* NOTES
* Should csi be an LPFONTSIGNATURE instead of an LPCHARSETINFO?
* Should it return a UINT32 instead of an INT32?
* => YES and YES, from win32.hlp from Borland
*
* This returns the actual charset selected by the driver rather than the
* value in lf.lfCharSet during CreateFont, to get that use
* GetObject(GetCurrentObject(...),...)
*
* RETURNS
* Success: Character set identifier
* Failure: DEFAULT_CHARSET
*/
UINT WINAPI GetTextCharsetInfo(
HDC hdc, /* [in] Handle to device context */
LPFONTSIGNATURE fs, /* [out] Pointer to struct to receive data */
DWORD flags) /* [in] Reserved - must be 0 */
{
UINT charSet = DEFAULT_CHARSET;
CHARSETINFO csinfo;
TEXTMETRICW tm;
if(!GetTextMetricsW(hdc, &tm)) return DEFAULT_CHARSET;
charSet = tm.tmCharSet;
if (fs != NULL) {
if (!TranslateCharsetInfo((LPDWORD)charSet, &csinfo, TCI_SRCCHARSET))
return DEFAULT_CHARSET;
memcpy(fs, &csinfo.fs, sizeof(FONTSIGNATURE));
}
return charSet;
}
/***********************************************************************
* PolyTextOutA (GDI32.@)
*
* Draw several Strings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment