@@ -178,7 +178,6 @@ GetFont(
178
178
179
179
static void
180
180
GetTkFontAttributes (
181
- Tk_Window tkwin ,
182
181
XftFont * ftFont ,
183
182
TkFontAttributes * faPtr )
184
183
{
@@ -188,12 +187,12 @@ GetTkFontAttributes(
188
187
double size , ptsize ;
189
188
190
189
(void ) XftPatternGetString (ftFont -> pattern , XFT_FAMILY , 0 , familyPtr );
191
- if (XftPatternGetDouble (ftFont -> pattern , XFT_PIXEL_SIZE , 0 ,
192
- & ptsize ) == XftResultMatch ) {
193
- size = - ptsize ;
194
- } else if (XftPatternGetDouble (ftFont -> pattern , XFT_SIZE , 0 ,
190
+ if (XftPatternGetDouble (ftFont -> pattern , XFT_SIZE , 0 ,
195
191
& ptsize ) == XftResultMatch ) {
196
192
size = ptsize ;
193
+ } else if (XftPatternGetDouble (ftFont -> pattern , XFT_PIXEL_SIZE , 0 ,
194
+ & ptsize ) == XftResultMatch ) {
195
+ size = - ptsize ;
197
196
} else if (XftPatternGetInteger (ftFont -> pattern , XFT_PIXEL_SIZE , 0 ,
198
197
& pxsize ) == XftResultMatch ) {
199
198
size = (double )- pxsize ;
@@ -215,7 +214,7 @@ GetTkFontAttributes(
215
214
#endif /* DEBUG_FONTSEL */
216
215
217
216
faPtr -> family = Tk_GetUid (family );
218
- faPtr -> size = TkFontGetPoints ( tkwin , size ) ;
217
+ faPtr -> size = size ;
219
218
faPtr -> weight = (weight > XFT_WEIGHT_MEDIUM ) ? TK_FW_BOLD : TK_FW_NORMAL ;
220
219
faPtr -> slant = (slant > XFT_SLANT_ROMAN ) ? TK_FS_ITALIC : TK_FS_ROMAN ;
221
220
faPtr -> underline = 0 ;
@@ -351,7 +350,7 @@ InitFont(
351
350
return NULL ;
352
351
}
353
352
fontPtr -> font .fid = XLoadFont (Tk_Display (tkwin ), "fixed" );
354
- GetTkFontAttributes (tkwin , ftFont , & fontPtr -> font .fa );
353
+ GetTkFontAttributes (ftFont , & fontPtr -> font .fa );
355
354
GetTkFontMetrics (ftFont , & fontPtr -> font .fm );
356
355
Tk_DeleteErrorHandler (handler );
357
356
if (errorFlag ) {
@@ -507,7 +506,7 @@ TkpGetFontFromAttributes(
507
506
if (faPtr -> size > 0.0 ) {
508
507
XftPatternAddDouble (pattern , XFT_SIZE , faPtr -> size );
509
508
} else if (faPtr -> size < 0.0 ) {
510
- XftPatternAddDouble (pattern , XFT_PIXEL_SIZE , - faPtr -> size );
509
+ XftPatternAddDouble (pattern , XFT_SIZE , TkFontGetPoints ( tkwin , faPtr -> size ) );
511
510
} else {
512
511
XftPatternAddDouble (pattern , XFT_SIZE , 12.0 );
513
512
}
@@ -676,7 +675,7 @@ TkpGetSubFonts(
676
675
677
676
void
678
677
TkpGetFontAttrsForChar (
679
- Tk_Window tkwin , /* Window on the font's display */
678
+ TCL_UNUSED ( Tk_Window ), /* Window on the font's display */
680
679
Tk_Font tkfont , /* Font to query */
681
680
int c , /* Character of interest */
682
681
TkFontAttributes * faPtr ) /* Output: Font attributes */
@@ -688,7 +687,7 @@ TkpGetFontAttrsForChar(
688
687
XftFont * ftFont = GetFont (fontPtr , ucs4 , 0.0 );
689
688
/* Actual font used to render the character */
690
689
691
- GetTkFontAttributes (tkwin , ftFont , faPtr );
690
+ GetTkFontAttributes (ftFont , faPtr );
692
691
faPtr -> underline = fontPtr -> font .fa .underline ;
693
692
faPtr -> overstrike = fontPtr -> font .fa .overstrike ;
694
693
}
0 commit comments