summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-07-28Fix `cmap` Subtable Format 4 `entrySelector`philg314
https://docs.microsoft.com/en-us/typography/opentype/spec/cmap defines `entrySelector` as "Log2 of the maximum power of 2 less than or equal to numTables (log2(searchRange/2), which is equal to floor(log2(segCount)))" Part-of: <https://gitlab.freedesktop.org/xorg/app/fonttosfnt/-/merge_requests/17>
2024-02-15unifdef NEED_SNPRINTFAlan Coopersmith
If it was defined, it would try to include a snprintf.c file that's not actually in our source tree. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-15unifdef __SCO__Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-15unifdef __UNIXOS2__Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-09-27fonttosfnt 1.2.3fonttosfnt-1.2.3Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-04-01Use C99 compound literals to initialize newly allocated structsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-04-01Allow inlining makeNameAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-04-01Remove unused function findIndexAlan Coopersmith
Found by cppcheck Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-04-01makeBitmap: declare raster parameter const as recommended by cppcheckAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-04-01args_copy variable is unused if HAVE_DECL_VA_COPY is not definedAlan Coopersmith
Found by cppcheck Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-04-01Variable scope reductions as recommended by cppcheckAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-23gitlab CI: enable gitlab's builtin static analysisAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-23gitlab CI: enable commit & merge request checksAlan Coopersmith
Uses ci-fairy from freedesktop/ci-templates Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-03Build xz tarballs instead of bzip2Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-08-23Add CI testsPeng Wu
2021-06-15Bump to 1.2.2fonttosfnt-1.2.2Peter Hutterer
2021-06-141em is font size, not heightChristopher Zimmermann
2021-05-25Fail if ftell failsPeter Hutterer
Fixes a coverity warning: ftell may return -1 on error which we then pass into fseek later. We properly fail there anyway, so this change is unlikely to have any real effect.
2020-12-16Bump to 1.2.1fonttosfnt-1.2.1Peter Hutterer
2020-10-31writeFile: avoid file leak on errorsAlan Coopersmith
Resolves issues found by Oracle Parfait 4.0 static analyser: File Leak [file-ptr-leak]: Leaked File out at line 337 of app/fonttosfnt/write.c in function 'writeFile'. out initialized at line 330 with fopen File Leak [file-ptr-leak]: Leaked File out at line 366 of app/fonttosfnt/write.c in function 'writeFile'. out initialized at line 330 with fopen Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-10-26Fall back to using FONT property as family nameChristopher Zimmermann
2020-10-24fix sign of calculated descentChristopher Zimmermann
I discovered this bug when converting the Tamsyn font from pcf to otb.
2020-10-23handle empty foundry encoded as NULLChristopher Zimmermann
to fix a segfault
2020-10-23remove leftover debug printfChristopher Zimmermann
2020-10-21Bump to 1.2.0fonttosfnt-1.2.0Peter Hutterer
2020-09-22use PIXEL_SIZE to calculate lineGapChristopher Zimmermann
2020-09-22fix sign of sTypoDescenderChristopher Zimmermann
2020-09-22calculate capHeight and xHeight as recommendedChristopher Zimmermann
2020-09-22move metrics calculation to write.cChristopher Zimmermann
2020-09-22Add warnings when wrapping multiple fonts and on PCF fontsChristopher Zimmermann
2020-09-22provide version 5 OS/2 tableChristopher Zimmermann
this was an attempt to fix linespacing, which did not help, but would still keep it around to avoid double efforts.
2020-09-22use design metrics in eblc instead of calculated metricsChristopher Zimmermann
This will probably not work for a font providing multiple strikes. But .bdf fonts don't provide multiple strikes (or do they?!?) I don't know about .pcf fonts, but I would recommend against running fonttosfnt on .pcf fonts because bdf2pcf seems to loose some attributes during conversion.
2020-09-22use more properties according to XLFDChristopher Zimmermann
2020-09-22use standard C rounding functionsChristopher Zimmermann
2020-09-22correctly set OS2 fsSelection for italic and bold fontsChristopher Zimmermann
2020-09-22truncate foundry if there is no known abbreviation.Christopher Zimmermann
Honestly I have no idea why the foundry needs to fit in four bytes. But anyway truncation might indeed be better then "UNKN" ? Anyone more knowledgeable than me out there?
2020-09-22use zero lineGap, sTypoDescender should be negativeChristopher Zimmermann
According to https://simoncozens.github.io/fonts-and-layout/opentype.html#vertical-metrics-hhea-and-os2 sTypoDescender should be negative and lineGap should be zero.
2020-09-22don't add arbitrary number to the glypth metricsChristopher Zimmermann
This caused pango to calculate wrong, too large font extents and in consequence gvim used too large character cells.
2020-06-11Guess Regular style for Medium WeightPeng Wu
X Logical Font Description recognize "Medium" as "Regular". Update the faceWeight function to change style from "Medium" to "Regular".
2020-02-07Fix uninitialised memory writernhmjoj
If macTime() fails write zeros instead of unitialized memory to the date fields.
2020-02-07Fix incorrect error handling in macTime()rnhmjoj
mktime() and time() return (time_t -1) to signal an error. Checking for negative values will incorrectly assume an error happened for any calendar date before the unix epoch.
2020-01-06Bump to 1.1.0fonttosfnt-1.1.0Peter Hutterer
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-25Accept a BDF font on stdinJouke Witteveen
This makes it easier to transition from bdftopcf. Although an OTB file could include fonts from multiple BDF sources, that functionality is not currently implemented for fonts read from stdin. Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
2019-12-25Mention .otb as an extensionJouke Witteveen
The OTB (OpenType Bitmap) extension has found some traction, so suggest that. Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
2019-12-25Correct a string literalJouke Witteveen
Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
2019-12-05Round font size to integer value when reading bitmap fontPeng Wu
Some fonts have a ppem value like 11.9, this patch adds integer rounding to convert those ppem value to 12 instead of 11.
2019-12-04allow ISO-646.1991-IRV as well, adobe standard for bdfRyan Farley
Allow for BDF file with no specified encoding to be read as Adobe Standard (per freetype's BDF driver), and handle any Unicode-equivalent encoding without changing the encoding name.
2019-12-04let freetype handle ISO-8859-1 mappingRyan Farley
https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#ft_encoding indicates that ISO-8859-1 is automatically mapped to Unicode for BDF and PCF fonts -- trying to use FT_Select_Charmap() with FT_ENCODING_NONE leads to an error for such fonts.
2019-08-30check for freetype NULL atomsRyan Farley
Freetype uses NULL to represent an empty string when retrieving a BDF property -- check for this in addition to an actual error
2019-01-10Avoid undefined behaviourMaya Rashish
Left shifting a negative is undefined. For consistency, use the equivalent form of multiplication for the positive numbers as well.