diff options
author | fvogel <fvogelnew1@free.fr> | 2023-11-06 20:16:02 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-11-06 20:16:02 (GMT) |
commit | dc3361819bfbe50f821612d43f9e0ca8a7406e9e (patch) | |
tree | 47aa1d198cbdf84198ef309e8c1ad788ade0210e /unix/tkUnixRFont.c | |
parent | 4d25a50dadf2d7f411ca4e53e7b72ac60cd4bd28 (diff) | |
download | tk-dc3361819bfbe50f821612d43f9e0ca8a7406e9e.zip tk-dc3361819bfbe50f821612d43f9e0ca8a7406e9e.tar.gz tk-dc3361819bfbe50f821612d43f9e0ca8a7406e9e.tar.bz2 |
Backout [3f4e8a7f] since it triggers an unexpected failure in the main branch.
Diffstat (limited to 'unix/tkUnixRFont.c')
-rw-r--r-- | unix/tkUnixRFont.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 72692fc..6d826ea 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -185,7 +185,6 @@ GetFont( static void GetTkFontAttributes( - Tk_Window tkwin, XftFont *ftFont, TkFontAttributes *faPtr) { @@ -195,12 +194,12 @@ GetTkFontAttributes( double size, ptsize; (void) XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0, familyPtr); - if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, - &ptsize) == XftResultMatch) { - size = -ptsize; - } else if (XftPatternGetDouble(ftFont->pattern, XFT_SIZE, 0, + if (XftPatternGetDouble(ftFont->pattern, XFT_SIZE, 0, &ptsize) == XftResultMatch) { size = ptsize; + } else if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, + &ptsize) == XftResultMatch) { + size = -ptsize; } else if (XftPatternGetInteger(ftFont->pattern, XFT_PIXEL_SIZE, 0, &pxsize) == XftResultMatch) { size = (double)-pxsize; @@ -222,7 +221,7 @@ GetTkFontAttributes( #endif /* DEBUG_FONTSEL */ faPtr->family = Tk_GetUid(family); - faPtr->size = TkFontGetPoints(tkwin, size); + faPtr->size = size; faPtr->weight = (weight > XFT_WEIGHT_MEDIUM) ? TK_FW_BOLD : TK_FW_NORMAL; faPtr->slant = (slant > XFT_SLANT_ROMAN) ? TK_FS_ITALIC : TK_FS_ROMAN; faPtr->underline = 0; @@ -358,7 +357,7 @@ InitFont( return NULL; } fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed"); - GetTkFontAttributes(tkwin, ftFont, &fontPtr->font.fa); + GetTkFontAttributes(ftFont, &fontPtr->font.fa); GetTkFontMetrics(ftFont, &fontPtr->font.fm); Tk_DeleteErrorHandler(handler); if (errorFlag) { @@ -514,7 +513,7 @@ TkpGetFontFromAttributes( if (faPtr->size > 0.0) { XftPatternAddDouble(pattern, XFT_SIZE, faPtr->size); } else if (faPtr->size < 0.0) { - XftPatternAddDouble(pattern, XFT_PIXEL_SIZE, -faPtr->size); + XftPatternAddDouble(pattern, XFT_SIZE, TkFontGetPoints(tkwin, faPtr->size)); } else { XftPatternAddDouble(pattern, XFT_SIZE, 12.0); } @@ -683,7 +682,7 @@ TkpGetSubFonts( void TkpGetFontAttrsForChar( - Tk_Window tkwin, /* Window on the font's display */ + TCL_UNUSED(Tk_Window), /* Window on the font's display */ Tk_Font tkfont, /* Font to query */ int c, /* Character of interest */ TkFontAttributes *faPtr) /* Output: Font attributes */ @@ -695,7 +694,7 @@ TkpGetFontAttrsForChar( XftFont *ftFont = GetFont(fontPtr, ucs4, 0.0); /* Actual font used to render the character */ - GetTkFontAttributes(tkwin, ftFont, faPtr); + GetTkFontAttributes(ftFont, faPtr); faPtr->underline = fontPtr->font.fa.underline; faPtr->overstrike = fontPtr->font.fa.overstrike; } |