aboutsummaryrefslogtreecommitdiff
path: root/src/libdraw/font.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-10Trivial changes: whitespace and modes.Dan Cross1-2/+2
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>
2018-11-16libdraw: redo default font construction to be hidpi-safeRuss Cox1-2/+1
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.
2017-04-08libdraw: replace hand-rolled realloc, preventing buffer overflow.Ray Lai1-3/+1
The original buffer is f->nsubf*sizeof *subf bytes (oldsize) large. Once it's full, a new buffer of (f->nsubf+DSUBF)*sizeof *subf (newsize) is mallocated. Unfortunately memmove() reads (newsize) bytes from the original (oldsize) buffer, causing a buffer overflow. By switching to realloc(), we don't need to do buffer size calculation, memmoving, and freeing of the original buffer. Change-Id: Ibf85bc06abe1c8275b11acb1d7d346a14291d2cd Reviewed-on: https://plan9port-review.googlesource.com/1520 Reviewed-by: Gleydson Soares <gsoares@gmail.com>
2005-07-13more places where display can be nilrsc1-1/+1
2005-05-12handle arbitrary length names in subfontname.rsc1-3/+5
handle overflow in offset computation in font.c
2004-04-25make it possible to access fonts without a display.rsc1-3/+10
2004-03-05Amazingly picky bug fixes from Valgrind.rsc1-1/+1
2003-09-30Initial revisionrsc1-0/+401