The configure script has already been requiring freetype-2.1.10+, so
this isn't really dropping old support. Even then, 2.1.3 was released
in 2002, so users have had plenty of time to upgrade.
We change the return type of `textLayout()` to `ssize_t`, and signal
failure by returning `-1`, so that laying out an empty string is no
longer handled as failure. We make sure that no overflow occurs,
assuming that all `int` values can be fully represented as `ssize_t`.
All the uses of strncpy in here are based on strlen of the input, so
there's no need to run through an str-based func again. Switch to a
straight memcpy. Plus this avoids static checkers that blindly choke
on strncpy. The code was already adding a trailing NUL byte, so that
isn't problematic either.
The following API functions now accept the font names and the text to be
printed as `const char*` rater than `char*`. This makes the functions
much more `C++` friendly.
gdImageStringFT();
gdImageStringTTF();
gdImageStringFTEx();
Other functions/types affected:
typeed struct fontkey_t;
any2eucjp();
gdTcl_UtfToUniChar();
DetectKanjiCode();
do_convert();
do_check_and_conv();
If fontconfig support is disabled, the static functions font_pattern() and
useFontConfig() are never used. This can lead to build errors, and does so
with the current default settings `-Wall -Werror`. Therefore we ensure that
these functions are not compiled when they are not needed.
This makes the code better readable in the sources, and we get syntax
highlighting in the generated HTML wherever we want it (i.e. not necessarily
always as with `-hl all`).
In file included from gdft.c:20:0:
entities.h:17:4: error: 'entities' defined but not used [-Werror=unused-variable]
gdft.c:1741:15: error: 'font_path' defined but not used [-Werror=unused-function]
static char * font_path(char **fontpath, char *name_list)
This pull request (based on Asma's works) adds support for languages that require [complex text
layout](https://en.wikipedia.org/wiki/Complex_text_layout).
We are using [libraqm](https://github.com/HOST-Oman/libraqm), a small source
code-only library that wraps FriBidi (for bidirectional text support) and
HarfBuzz (for text shaping), and does proper BiDi and script itemization.
The CTL support is enabled by default but can be disabled at compiling time,
and we provide a fallback function that uses your original code without CTL
support.
MAXPATHLEN is set to 256 (on some systems), and DEFAULT_FONTPATH is longer
than this (on some systems). The sprintf() to path[MAXPATHLEN] thus
resulted in a buffer overrun when in some circumstances (also,
fontsearchpath is in the control of the environment, so this could be
triggered on any platform).
This changeset imports documention for gdImage to gdImagePng*() into
Natural Docs. Documention is based on the text of the original
manual, version 2.0.36 but adapted to better suit the format.
Subsequent changesets will introduce docs for subsequent manual
entries.
naturaldocs, when present, is invoked by bootstrap.sh. The completed
manual will be in docs/naturaldocs/html/index.html. It can also be
explicitly invoked by running docs/naturaldocs/run_docs.sh.
This change also removed docs/naturaldocs/project/Menu.txt, since it
currently contains no non-generated content and is prone to introduce
noise into the changeset.