aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/fontsrv
Commit message (Collapse)AuthorAgeFilesLines
* all: remove need for `-fcommon`Dan Cross2025-07-252-2/+5
| | | | | | | | | | Use `extern` where appropriate so that we can remove `-fcommon` on macOS and others. On macOS, `-fcommon` generates a number of linker warnings. I've tested building on macOS, Linux, FreeBSD, NetBSD, OpenBSD and illumos. I am not in a position to test on AIX or other more esoteric platforms, however.
* fontsrv: always compute new height and ascent for the font fileXiao-Yong Jin2022-07-261-9/+14
|
* src/cmd/fontsrv: pad subfile names to support correct file lengthKyle Nusbaum2022-07-261-4/+4
| | | | | | | | For fonts with subfiles that go beyond the xffff range, the font file size calculation is incorrect, since lines beyond that range have additional characters. This patch pads all of the ranges and subfont names with leading zeros in order to keep them all lines the same length and fixes the font file length calculation.
* fontsrv: fix handling of colored glyphs (emoji)Russ Cox2020-08-151-5/+17
| | | | | | | Drawing as white on black to produce a mask only works if the white on black is the inversion of black on white. Emoji that force use of specific colors don't respect that. Draw black on white and invert to mask separately.
* fontsrv: fix compilation on X11 (#420)Gregor Best2020-06-041-0/+1
|
* fontsrv: scale f->originy to match f->height on x11dzklaim2020-05-291-1/+1
| | | Co-authored-by: dzklaim <smmoth.rp@gmail.com>
* fontsrv: handle non-BMP runes on X11Russ Cox2020-05-294-43/+44
| | | | | Have to adjust algorithms to deal with much larger number of subfont files as well.
* devdraw: use consistent mac-* prefix on macOS filesRuss Cox2020-01-133-3/+0
| | | | We were using osx- and cocoa- but it's not even OS X anymore.
* fontsrv: allow x11 hinting and disable autohint only (#254)Xiao-Yong2020-01-131-1/+1
| | | | | Some truetype fonts have good manual hinting. Ignoring hinting makes the font render badly on low resolution screens. This commit only disables the freetype autohinter, and allows hinting.
* Trivial changes: whitespace and modes.Dan Cross2020-01-103-29/+28
| | | | | | | | | Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
* libdraw: redo default font construction to be hidpi-safeRuss Cox2018-11-162-4/+0
| | | | | | | | | | | | | | | | If $font is not set, the default font is constructed from font data linked into every libdraw binary. That process was different from the usual openfont code, and so it was not hidpi-aware, resulting in very tiny fonts out of the box on hidpi systems, until users set $font. Fix this by using openfont to construct the default font, by recognizing the name *default* when looking for font and subfont file contents. Then all the hidpi scaling applies automatically. As a side effect, the concept of a 'default subfont' is gone, as are display->defaultsubfont, getdefont, and memgetdefont.
* fontsrv: increase x11 font height scale (#111)iru-2018-11-141-1/+1
|
* fontsrv: x11 uses FC_POSTSCRIPT_NAME (#174)Xiao-Yong2018-11-131-1/+1
| | | | | | | This makes fontsrv use the PostScript font names on X11. The PostScript font names contains only alphanumeric and hyphens. This allows us to use the Font command in acme. It also matches the font names used by fontsrv on macOS, which has been using PostScript font names.
* fontsrv: disable font smoothing on osx (#196)Xiao-Yong2018-11-132-0/+4
| | | | | | macOS Mojave version 10.14 starts to disable font smoothing. We disable font smoothing for OSX_VERSION >= 101400 to match the system default font rendering. It also makes the font rendering on macOS similar to that on X11.
* fontsrv: copy some fixes from OS X to X11Fazlul Shahriar2018-10-051-38/+43
| | | | | | | | | | | | | | | | | * Avoid allocating empty images by adding 1 to width/height. This was crashing fontsrv. The total width of the subfont image can be zero even if the characters are present in the font. For example, all the characters in x0300.bit (part of "Combining Diacritical Marks" Unicode block) have zero width. * Make sure U+0000 is always present in the font, otherwise libdraw complains with: "stringwidth: bad character set for rune 0x0000 in ..." * Use the same fallback glyph (pjw face) as OS X. This also fixes a bug where advance was set to the total width of subfont instead of the character. Update #125 (most likely fixes the crash if in X11) Change-Id: Icdc2b641b8b0c08644569006e91cf613b4d5477f
* fontsrv: omit box-drawing characters from line struts on macOSIgor Burago2018-06-261-1/+1
| | | | | | | | | For some fonts, using box-drawing characters in the representative text for computing the line height results in it being uncomfortably high. Replace them with accented capitals and tall lower-case letters which lead to a more conservative increase in the line height. Fixes #162.
* fontsrv: fix some memory leaksXiao-Yong Jin2018-03-272-1/+4
|
* fontsrv: enlarge drawing buffer for subfonts on macOSXiao-Yong Jin2018-03-271-1/+3
| | | | | | | | | | Double the width returned by CTFontGetBoundingBox when drawing. Add box drawing characters for determining the line height. Call freememimage(1) for the character memimage. Fixes #18. Fixes #120. Fixes #146.
* fontsrv: skip only the surrogate pairsMechiel Lukkien2018-03-231-1/+1
| | | | | fontsrv wasn't rendering fontawesome icons, which uses the private use area around 0xf000.
* fontsrv: avoid quote mapping on fonts with indistinguishable quotesRuss Cox2017-06-191-5/+19
| | | | | | | | Fixes #86. Change-Id: Id487219a0fcfdb68133fc81b11383365a1431c1c Reviewed-on: https://plan9port-review.googlesource.com/2922 Reviewed-by: Russ Cox <rsc@swtch.com>
* fontsrv: do not try to look up surrogate pairsRuss Cox2016-01-221-0/+2
| | | | | | Change-Id: Ib0a680e123ba02b41e1029e356543c24e8b4647e Reviewed-on: https://plan9port-review.googlesource.com/1430 Reviewed-by: Russ Cox <rsc@swtch.com>
* fontsrv: use 64 chars per subfont instead of 256Russ Cox2015-08-273-8/+13
| | | | | | | | Makes loading faster, and makes larger sizes not too wide. Change-Id: I076c83fdb9577c1e596de45558f38ea93e3a2a31 Reviewed-on: https://plan9port-review.googlesource.com/1360 Reviewed-by: Russ Cox <rsc@swtch.com>
* fontsrv: fix x11 buildRuss Cox2015-02-181-1/+0
| | | | | | Change-Id: I60eca10d7749ec71dc2ffbb0fbde564a1b711fa1 Reviewed-on: https://plan9port-review.googlesource.com/1180 Reviewed-by: Russ Cox <rsc@swtch.com>
* fontsrv: use CoreText API on OS XRuss Cox2015-02-175-106/+143
| | | | | | | | | This gets us font fallback for free and avoids use of a deprecated API that might go away some day. Change-Id: I4b9b1a1ce3e6d98bfb407e3baea13f4adfe2c26a Reviewed-on: https://plan9port-review.googlesource.com/1160 Reviewed-by: Russ Cox <rsc@swtch.com>
* fontsrv: disable X11 hintingEthan Burns2014-12-021-1/+1
| | | | | | | | | Discussion at: https://groups.google.com/d/topic/plan9port-dev/L7RVkXPmrdY/discussion https://github.com/9fans/plan9port/pull/7 Change-Id: I4f3a6791436120388ad8798e519f5e8473dd9306 Reviewed-on: https://plan9port-review.googlesource.com/1095
* fix gcc 4.8 warningsDavid du Colombier2014-03-031-1/+1
| | | | | | LGTM=rsc R=rsc https://codereview.appspot.com/33240044
* fontsrv: fix on X11 when X11H is not definedAlessandro Arzilli2013-01-301-1/+1
| | | | | | R=rsc CC=plan9port.codebot https://codereview.appspot.com/7228044
* fontsrv: fix build on OpenBSD 5.2Christian Kellermann2012-12-112-2/+7
| | | | | | R=rsc CC=plan9port.codebot https://codereview.appspot.com/6850108
* fontsrv: make single quotes look like quotesRuss Cox2012-12-031-3/+15
| | | | | R=rsc https://codereview.appspot.com/6864051
* fontsrv: scaled pjwRuss Cox2012-12-015-11/+369
| | | | | R=rsc https://codereview.appspot.com/6854130
* fontsrv: work around a few crashesRuss Cox2012-11-251-2/+6
| | | | | | | Probably not the right fix, but gets us going. R=rsc http://codereview.appspot.com/6782113
* fontsrv: x11 supportYuval Pavel Zholkover2012-10-214-3/+274
| | | | | | R=rsc, 0intro CC=plan9port.codebot http://codereview.appspot.com/6739047
* fix INSTALL warningsRuss Cox2012-05-292-1/+2
| | | | | R=rsc http://codereview.appspot.com/6258060
* fontsrv: add half-documented -s optionRuss Cox2009-07-081-4/+8
|
* mergeRuss Cox2009-07-086-0/+946