diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-19 12:45:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-19 12:45:35 (GMT) |
commit | 59397f45e5a4819512c43d7ace8b14e1dbecc79b (patch) | |
tree | 329065a2785c3d6196bc67333bacb15c8379cce9 /unix/tkUnixFont.c | |
parent | 287992b11802f6db4858b4774ea45a92a734cba7 (diff) | |
parent | 3cd4896cce0f31dd0ae402a6ac1abcb18c52e03f (diff) | |
download | tk-59397f45e5a4819512c43d7ace8b14e1dbecc79b.zip tk-59397f45e5a4819512c43d7ace8b14e1dbecc79b.tar.gz tk-59397f45e5a4819512c43d7ace8b14e1dbecc79b.tar.bz2 |
Slightly use of more "int" in stead of double, for 100% compatibility at script level.
Diffstat (limited to 'unix/tkUnixFont.c')
-rw-r--r-- | unix/tkUnixFont.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index e2ce2bc..b361e83 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -1535,7 +1535,7 @@ CreateClosestFont( continue; } IdentifySymbolEncodings(&got); - scalable = (got.fa.size == 0); + scalable = (got.fa.size == 0.0); score = RankAttributes(&want, &got); if (score < bestScore[scalable]) { bestIdx[scalable] = nameIdx; @@ -2453,7 +2453,7 @@ CanUseFallback( want.xa = fontPtr->xa; want.fa.family = Tk_GetUid(faceName); - want.fa.size = -fontPtr->pixelSize; + want.fa.size = (double)-fontPtr->pixelSize; hateFoundry = NULL; hateCharset = NULL; @@ -2536,7 +2536,7 @@ CanUseFallback( * D. Rank each name and pick the best match. */ - scalable = (got.fa.size == 0); + scalable = (got.fa.size == 0.0); score = RankAttributes(&want, &got); if (score < bestScore[scalable]) { bestIdx[scalable] = nameIdx; @@ -2665,7 +2665,7 @@ RankAttributes( penalty += 1000; } - if (gotPtr->fa.size == 0) { + if (gotPtr->fa.size == 0.0) { /* * A scalable font is almost always acceptable, but the corresponding * bitmapped font would be better. @@ -2679,14 +2679,14 @@ RankAttributes( * It's worse to be too large than to be too small. */ - diff = (-gotPtr->fa.size - -wantPtr->fa.size); + diff = (int) (150 * (-gotPtr->fa.size - -wantPtr->fa.size)); if (diff > 0) { penalty += 600; } else if (diff < 0) { penalty += 150; diff = -diff; } - penalty += 150 * diff; + penalty += diff; } if (gotPtr->xa.charset != wantPtr->xa.charset) { int i; |