diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-09-22 20:20:04 -0400 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-09-22 20:20:04 -0400 |
commit | 90b14882ec253e12312974e0f6e129497df5ea78 (patch) | |
tree | 2915267ad3de002ef5704787625dfbc0e478a7ed | |
parent | b4dddd8244fb59795f030530ad2b401ec4d5b477 (diff) | |
download | freetype2-90b14882ec253e12312974e0f6e129497df5ea78.tar.gz |
[bdf, pcf] Minor optimization.
* src/pcf/pcfread.c (pcf_load_font): Do not call `FT_MulDiv` for a
small job.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto.
* src/bdf/bdflib.c (_bdf_parse_glyphs): Fix a comment.
-rw-r--r-- | src/bdf/bdfdrivr.c | 2 | ||||
-rw-r--r-- | src/bdf/bdflib.c | 2 | ||||
-rw-r--r-- | src/pcf/pcfread.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c index 5c7b1f569..eb73a7cf9 100644 --- a/src/bdf/bdfdrivr.c +++ b/src/bdf/bdfdrivr.c @@ -487,7 +487,7 @@ THE SOFTWARE. else { /* this is a heuristical value */ - bsize->width = (FT_Short)FT_MulDiv( bsize->height, 2, 3 ); + bsize->width = ( bsize->height * 2 + 1 ) / 3; } prop = bdf_get_font_property( font, "POINT_SIZE" ); diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c index d2a24dd20..eebdbf85e 100644 --- a/src/bdf/bdflib.c +++ b/src/bdf/bdflib.c @@ -1615,7 +1615,7 @@ goto Exit; } - /* Expect the DWIDTH (scalable width) field next. */ + /* Expect the DWIDTH (device width) field next. */ if ( _bdf_strncmp( line, "DWIDTH", 6 ) == 0 ) { error = _bdf_list_split( &p->list, " +", line, linelen ); diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c index 0705dadcf..4c6823ac2 100644 --- a/src/pcf/pcfread.c +++ b/src/pcf/pcfread.c @@ -1612,7 +1612,7 @@ THE SOFTWARE. else { /* this is a heuristical value */ - bsize->width = (FT_Short)FT_MulDiv( bsize->height, 2, 3 ); + bsize->width = ( bsize->height * 2 + 1 ) / 3; } prop = pcf_find_property( face, "POINT_SIZE" ); |