Merge remote-tracking branch 'origin/5.14' into 5.15

Change-Id: I963b5f48b5d6f3500ca379fbd7f1a4290b570175
This commit is contained in:
Qt Forward Merge Bot 2019-11-08 09:11:01 +01:00
commit 78c687f98e
569 changed files with 39582 additions and 35191 deletions

69
dist/changes-5.13.2 vendored Normal file
View File

@ -0,0 +1,69 @@
Qt 5.13.2 is a bug-fix release. It maintains both forward and backward
compatibility (source and binary) with Qt 5.13.0 through 5.13.1.
For more details, refer to the online documentation included in this
distribution. The documentation is also available online:
https://doc.qt.io/qt-5/index.html
The Qt version 5.13 series is binary compatible with the 5.12.x series.
Applications compiled for 5.12 will continue to run with 5.13.
Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker:
https://bugreports.qt.io/
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
* QtCore *
****************************************************************************
- Fixed a bug that made qErrnoWarning() say there was no error when
generating the error message.
- QBitArray:
* Fixed two bugs that caused QBitArrays created using fromBits() not to
compare equal to the equivalent QBitArray created using other methods
if the size was zero or not a multiple of 4. If the size modulus 8 was
5, 6, or 7, the data was actually incorrect.
- QCryptographicHash:
* Fixed a bug that caused the SHA-3 and Keccak algorithms to crash if
passed 256 MB of data or more.
- QObject:
* Fixed a resource leak caused by a race condition if multiple QObjects
were created at the same time, for the first time in an application,
from multiple threads (implies threads not started with QThread).
****************************************************************************
* QtGui *
****************************************************************************
- Text:
* [QTBUG-69546] Fixed a crash bug in
QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack).
****************************************************************************
* QtSQL *
****************************************************************************
- sqlite:
* Updated to v3.29.0
****************************************************************************
* Platform-Specific Changes *
****************************************************************************
- Linux:
* [QTBUG-61916] Added an environment variable
QT_QPA_PRESERVE_CONSOLE_STATE that can be used to prevent Qt from
altering the tty screen and cursor settings when running with
platforms like linuxfb and eglfs.
- Android:
* [QTBUG-76036] Fixed an issue where menus would not work on 64 bit
builds.

View File

@ -171,7 +171,7 @@ static const char *fsDisplaySource =
"}\n";
static const char *csComputeSourceV =
"#define COMPUTEPATCHSIZE 32 \n"
"#define COMPUTEPATCHSIZE 10 // Setting this to 10 to comply with MAX_COMPUTE_WORK_GROUP_INVOCATIONS for both OpenGL and OpenGLES - see QTBUG-79374 \n"
"#define IMGFMT rgba8 \n"
"layout (local_size_x = COMPUTEPATCHSIZE, local_size_y = COMPUTEPATCHSIZE) in;\n"
"layout(binding=0, IMGFMT) uniform readonly highp image2D inputImage; // Use a sampler to improve performance \n"
@ -212,7 +212,7 @@ static const char *csComputeSourceV =
"}\n";
static const char *csComputeSourceH =
"#define COMPUTEPATCHSIZE 32 \n"
"#define COMPUTEPATCHSIZE 10 \n"
"#define IMGFMT rgba8 \n"
"layout (local_size_x = COMPUTEPATCHSIZE, local_size_y = COMPUTEPATCHSIZE) in;\n"
"layout(binding=0, IMGFMT) uniform readonly highp image2D inputImage; // Use a sampler to improve performance \n"
@ -381,7 +381,7 @@ void GLWindow::paintGL()
// Process input image
QSize workGroups = getWorkGroups( 32, QSize(m_texImageInput->width(), m_texImageInput->height()));
QSize workGroups = getWorkGroups(10, QSize(m_texImageInput->width(), m_texImageInput->height()));
// Pass 1
f->glBindImageTexture(0, m_texImageInput->textureId(), 0, 0, 0, GL_READ_WRITE, GL_RGBA8);
f->glBindImageTexture(1, m_texImageTmp->textureId(), 0, 0, 0, GL_READ_WRITE, GL_RGBA8);

View File

@ -70,6 +70,11 @@ QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
QMAKE_LFLAGS_RPATH = -Wl,-rpath=
QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link=
equals(QMAKE_HOST.os, Windows) {
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT = object_script
}
QMAKE_LIBS_X11 =
QMAKE_LIBS_THREAD =
QMAKE_LIBS_OPENGL =

View File

@ -10,12 +10,12 @@
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
QMAKE_CC = $${CROSS_COMPILE}gcc
QMAKE_LINK_C = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC
QMAKE_CXX = g++
QMAKE_CXX = $${CROSS_COMPILE}g++
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX

View File

@ -5,9 +5,13 @@
QMAKE_PLATFORM += macos osx macx
QMAKE_MAC_SDK = macosx
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
QMAKE_APPLE_DEVICE_ARCHS = x86_64
QT_MAC_SDK_VERSION_MIN = 10.13
# Should be 10.15, but as long as the CI builds with
# older SDKs we have to keep this.
QT_MAC_SDK_VERSION_MIN = 10.14
QT_MAC_SDK_VERSION_MAX = 10.15
device.sdk = macosx

View File

@ -759,6 +759,8 @@ defineTest(qtConfLibrary_pkgConfig) {
return(false)
contains($${1}.libs, ".*\\.$${QMAKE_EXTENSION_STATICLIB}$") {
qtRunLoggedCommand("$$pkg_config --static --libs $$args", libs)|return(false)
# Split by space
eval(libs = $$libs)
!qtConfResolveLibs($${1}.libs, $$libs): \
return(false)
}

View File

@ -16,63 +16,8 @@ defineReplace(xml_escape) {
return($$1)
}
RESOURCES += qmake_immediate
for(resource, RESOURCES) {
# Regular case of user qrc file
contains(resource, ".*\\.qrc$"): \
next()
# Fallback for stand-alone files/directories
!defined($${resource}.files, var) {
!equals(resource, qmake_immediate) {
!exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \
warning("Failure to find: $$resource")
qmake_immediate.files += $$resource
OTHER_FILES *= $$resource
}
RESOURCES -= $$resource
next()
}
resource_file = $$absolute_path($$RCC_DIR/qmake_$${resource}.qrc, $$OUT_PWD)
isEmpty(BUILDS)|build_pass {
# Collection of files, generate qrc file
prefix = $$eval($${resource}.prefix)
isEmpty(prefix): \
prefix = "/"
resource_file_content = \
"<!DOCTYPE RCC><RCC version=\"1.0\">" \
"<qresource prefix=\"$$xml_escape($$prefix)\">"
abs_base = $$absolute_path($$eval($${resource}.base), $$_PRO_FILE_PWD_)
for(file, $${resource}.files) {
abs_path = $$absolute_path($$file, $$_PRO_FILE_PWD_)
files = $$files($$abs_path/*, true)
isEmpty(files): \
files = $$abs_path
for (file, files) {
exists($$file/*): next() # exclude directories
alias = $$relative_path($$file, $$abs_base)
resource_file_content += \
"<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>"
OTHER_FILES *= $$file
}
}
resource_file_content += \
"</qresource>" \
"</RCC>"
!write_file($$resource_file, resource_file_content): \
error()
}
RESOURCES -= $$resource
RESOURCES += $$resource_file
}
load(resources_functions)
qtFlattenResources()
!isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static {
pluginBaseName = $$basename(TARGET)

View File

@ -0,0 +1,63 @@
defineTest(qtFlattenResources) {
RESOURCES += qmake_immediate
for(resource, RESOURCES) {
# Regular case of user qrc file
contains(resource, ".*\\.qrc$"): \
next()
# Fallback for stand-alone files/directories
!defined($${resource}.files, var) {
!equals(resource, qmake_immediate) {
!exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \
warning("Failure to find: $$resource")
qmake_immediate.files += $$resource
OTHER_FILES *= $$resource
}
RESOURCES -= $$resource
next()
}
resource_file = $$absolute_path($$RCC_DIR/qmake_$${resource}.qrc, $$OUT_PWD)
isEmpty(BUILDS)|build_pass {
# Collection of files, generate qrc file
prefix = $$eval($${resource}.prefix)
isEmpty(prefix): \
prefix = "/"
resource_file_content = \
"<!DOCTYPE RCC><RCC version=\"1.0\">" \
"<qresource prefix=\"$$xml_escape($$prefix)\">"
abs_base = $$absolute_path($$eval($${resource}.base), $$_PRO_FILE_PWD_)
for(file, $${resource}.files) {
abs_path = $$absolute_path($$file, $$_PRO_FILE_PWD_)
files = $$files($$abs_path/*, true)
isEmpty(files): \
files = $$abs_path
for (file, files) {
exists($$file/*): next() # exclude directories
alias = $$relative_path($$file, $$abs_base)
resource_file_content += \
"<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>"
OTHER_FILES *= $$file
}
}
resource_file_content += \
"</qresource>" \
"</RCC>"
!write_file($$resource_file, resource_file_content): \
error()
}
RESOURCES -= $$resource
RESOURCES += $$resource_file
}
export(RESOURCES)
export(OTHER_FILES)
export(qmake_immediate.files)
return(true)
}

View File

@ -2,7 +2,7 @@
# qmake configuration for macx-ios-clang
#
QMAKE_IOS_DEPLOYMENT_TARGET = 11.0
QMAKE_IOS_DEPLOYMENT_TARGET = 12.0
# Universal target (iPhone and iPad)
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2

View File

@ -2,7 +2,7 @@
# qmake configuration for macx-tvos-clang
#
QMAKE_TVOS_DEPLOYMENT_TARGET = 11.0
QMAKE_TVOS_DEPLOYMENT_TARGET = 12.0
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 3

View File

@ -2,7 +2,7 @@
# qmake configuration for macx-watchos-clang
#
QMAKE_WATCHOS_DEPLOYMENT_TARGET = 4.0
QMAKE_WATCHOS_DEPLOYMENT_TARGET = 5.0
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 4

View File

@ -3455,4 +3455,28 @@ ProKey MakefileGenerator::fullTargetVariable() const
return "TARGET";
}
void MakefileGenerator::createResponseFile(const QString &fileName, const ProStringList &objList)
{
QString filePath = Option::output_dir + QDir::separator() + fileName;
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file);
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
QString path = (*it).toQString();
// In response files, whitespace and special characters are
// escaped with a backslash; backslashes themselves can either
// be escaped into double backslashes, or, as this is a list of
// path names, converted to forward slashes.
path.replace(QLatin1Char('\\'), QLatin1String("/"))
.replace(QLatin1Char(' '), QLatin1String("\\ "))
.replace(QLatin1Char('\t'), QLatin1String("\\\t"))
.replace(QLatin1Char('"'), QLatin1String("\\\""))
.replace(QLatin1Char('\''), QLatin1String("\\'"));
t << path << Qt::endl;
}
t.flush();
file.close();
}
}
QT_END_NAMESPACE

View File

@ -257,6 +257,7 @@ protected:
const QStringRef &fixedBase, int slashOff);
bool processPrlFileCore(QString &origFile, const QStringRef &origName,
const QString &fixedFile);
void createResponseFile(const QString &fileName, const ProStringList &objList);
public:
QMakeProject *projectFile() const;

View File

@ -58,7 +58,7 @@ protected:
void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags) override;
void writeMakeParts(QTextStream &);
bool writeMakefile(QTextStream &) override;
std::pair<bool, QString> writeObjectsPart(QTextStream &, bool do_incremental);
private:
void init2();
ProStringList libdirToFlags(const ProKey &key);

View File

@ -246,38 +246,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "####### Files\n\n";
// This is used by the dist target.
t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << Qt::endl;
if(do_incremental) {
const ProStringList &objs = project->values("OBJECTS");
const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
ProStringList incrs_out;
t << "OBJECTS = ";
for (ProStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
bool increment = false;
for (ProStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
if ((*objit).toQString().indexOf(QRegExp((*incrit).toQString(), Qt::CaseSensitive,
QRegExp::Wildcard)) != -1) {
increment = true;
incrs_out.append((*objit));
break;
}
}
if(!increment)
t << "\\\n\t\t" << (*objit);
}
if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
} else if(!incrs_out.count()) {
t << Qt::endl;
} else {
src_incremental = true;
t << Qt::endl;
t << "INCREMENTAL_OBJECTS = "
<< escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
}
} else {
// Used all over the place in both deps and commands.
t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << Qt::endl;
}
auto objectParts = writeObjectsPart(t, do_incremental);
src_incremental = objectParts.first;
if(do_incremental && !src_incremental)
do_incremental = false;
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
@ -513,7 +483,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << mkdir_p_asstring(destdir) << "\n\t";
if (!project->isEmpty("QMAKE_PRE_LINK"))
t << var("QMAKE_PRE_LINK") << "\n\t";
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)";
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) "
<< objectParts.second << " $(OBJCOMP) $(LIBS)";
if (!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
}
@ -1545,4 +1516,56 @@ UnixMakefileGenerator::writeLibtoolFile()
"libdir='" << Option::fixPathToTargetOS(install_dir.toQString(), false) << "'\n";
}
std::pair<bool, QString> UnixMakefileGenerator::writeObjectsPart(QTextStream &t, bool do_incremental)
{
bool src_incremental = false;
QString objectsLinkLine;
const ProStringList &objs = project->values("OBJECTS");
if (do_incremental) {
const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
ProStringList incrs_out;
t << "OBJECTS = ";
for (ProStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
bool increment = false;
for (ProStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
if ((*objit).toQString().indexOf(QRegExp((*incrit).toQString(), Qt::CaseSensitive,
QRegExp::Wildcard)) != -1) {
increment = true;
incrs_out.append((*objit));
break;
}
}
if (!increment)
t << "\\\n\t\t" << (*objit);
}
if (incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
} else if (!incrs_out.count()) {
t << endl;
} else {
src_incremental = true;
t << endl;
t << "INCREMENTAL_OBJECTS = "
<< escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
}
} else {
const ProString &objMax = project->first("QMAKE_LINK_OBJECT_MAX");
// Used all over the place in both deps and commands.
if (objMax.isEmpty() || project->values("OBJECTS").count() < objMax.toInt()) {
objectsLinkLine = "$(OBJECTS)";
} else {
QString ld_response_file = fileVar("OBJECTS_DIR");
ld_response_file += var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty())
ld_response_file += "." + var("BUILD_NAME");
if (!var("MAKEFILE").isEmpty())
ld_response_file += "." + var("MAKEFILE");
createResponseFile(ld_response_file, objs);
objectsLinkLine = "@" + escapeFilePath(ld_response_file);
}
t << "OBJECTS = " << valList(escapeDependencyPaths(objs)) << endl;
}
return std::make_pair(src_incremental, objectsLinkLine);
}
QT_END_NAMESPACE

View File

@ -115,30 +115,6 @@ QString MingwMakefileGenerator::installRoot() const
return QStringLiteral("$(INSTALL_ROOT:@msyshack@%=%)");
}
static void createResponseFile(const QString &fileName, const ProStringList &objList)
{
QString filePath = Option::output_dir + QDir::separator() + fileName;
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file);
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
QString path = (*it).toQString();
// In response files, whitespace and special characters are
// escaped with a backslash; backslashes themselves can either
// be escaped into double backslashes, or, as this is a list of
// path names, converted to forward slashes.
path.replace(QLatin1Char('\\'), QLatin1String("/"))
.replace(QLatin1Char(' '), QLatin1String("\\ "))
.replace(QLatin1Char('\t'), QLatin1String("\\\t"))
.replace(QLatin1Char('"'), QLatin1String("\\\""))
.replace(QLatin1Char('\''), QLatin1String("\\'"));
t << path << Qt::endl;
}
t.flush();
file.close();
}
}
void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
{
writeStandardParts(t);

View File

@ -1581,12 +1581,14 @@ void VcprojGenerator::initExtraCompilerOutputs()
if (!outputVar.isEmpty() && otherFilters.contains(outputVar))
continue;
QString tmp_out = project->first(outputs.first().toKey()).toQString();
QString tmp_out;
if (!outputs.isEmpty())
tmp_out = project->first(outputs.first().toKey()).toQString();
if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) {
// Combined output, only one file result
extraCompile.addFile(Option::fixPathToTargetOS(
replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell), false));
} else {
} else if (!inputVars.isEmpty()) {
// One output file per input
const ProStringList &tmp_in = project->values(inputVars.first().toKey());
for (int i = 0; i < tmp_in.count(); ++i) {

View File

@ -1,5 +1,5 @@
FreeType 2.9.1
==============
FreeType 2.10.1
===============
Homepage: https://www.freetype.org
@ -15,8 +15,8 @@
Read the files `docs/INSTALL*' for installation instructions; see
the file `docs/LICENSE.TXT' for the available licenses.
The FreeType 2 API reference is located in `docs/reference'; use the
file `ft2-toc.html' as the top entry point. Additional
The FreeType 2 API reference is located in `docs/reference/site';
use the file `index.html' as the top entry point. Additional
documentation is available as a separate package from our sites. Go
to
@ -24,13 +24,13 @@
and download one of the following files.
freetype-doc-2.9.1.tar.bz2
freetype-doc-2.9.1.tar.gz
ftdoc291.zip
freetype-doc-2.10.1.tar.xz
freetype-doc-2.10.1.tar.gz
ftdoc2101.zip
To view the documentation online, go to
https://www.freetype.org/freetype2/documentation.html
https://www.freetype.org/freetype2/docs/
Mailing Lists
@ -71,7 +71,7 @@
----------------------------------------------------------------------
Copyright 2006-2018 by
Copyright (C) 2006-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
/* */
/* Unix-specific FreeType low-level system interface (body). */
/* */
/* Copyright 1996-2018 by */
/* Copyright (C) 1996-2019 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -173,7 +173,7 @@
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_io
#define FT_COMPONENT io
/* We use the macro STREAM_FILE for convenience to extract the */
/* system-specific stream handle from a given FreeType stream object */

View File

@ -1,3 +1,184 @@
CHANGES BETWEEN 2.10.0 and 2.10.1
I. IMPORTANT BUG FIXES
- The bytecode hinting of OpenType variation fonts was flawed, since
the data in the `CVAR' table wasn't correctly applied.
II. MISCELLANEOUS
- Auto-hinter support for Mongolian.
- For distribution, `.tar.bz2' packages are replaced with `.tar.xz'
bundles.
- The handling of the default character in PCF fonts as introduced
in version 2.10.0 was partially broken, causing premature abortion
of charmap iteration for many fonts.
- If `FT_Set_Named_Instance' was called with the same arguments
twice in a row, the function returned an incorrect error code the
second time.
- Direct rendering using FT_RASTER_FLAG_DIRECT crashed (bug
introduced in version 2.10.0).
- Increased precision while computing OpenType font variation
instances.
- The flattening algorithm of cubic Bezier curves was slightly
changed to make it faster. This can cause very subtle rendering
changes, which aren't noticeable by the eye, however.
- The auto-hinter now disables hinting if there are blue zones
defined for a `style' (i.e., a certain combination of a script and
its related typographic features) but the font doesn't contain any
characters needed to set up at least one blue zone.
- The `ftmulti' demo program now supports multiple hidden axes with
the same name tag.
- `ftview', `ftstring', and `ftgrid' got a `-k' command line option
to emulate a sequence of keystrokes at start-up.
- `ftview', `ftstring', and `ftgrid' now support screen dumping to a
PNG file.
- The bytecode debugger, `ttdebug', now supports variation TrueType
fonts; a variation font instance can be selected with the new `-d'
command line option.
======================================================================
CHANGES BETWEEN 2.9.1 and 2.10.0
I. IMPORTANT CHANGES
- A bunch of new functions has been added to access and process
COLR/CPAL data of OpenType fonts with color-layered glyphs.
FT_Palette_Data_Get
Retrieve color palette data.
FT_Palette_Select
Select and activate a color palette for color-layered
glyphs.
FT_Palette_Set_Foreground_Color
Set text foreground color for palette index 0xFFFF.
FT_Get_Color_Glyph_Layer
Get color layers for a given glyph (using an interator
object).
FT_Bitmap_Blend
Blend one bitmap onto another with a given color.
- An experimental feature is the new behaviour of the
`FT_LOAD_COLOR' load flag for color-layered glyphs: Internally
it sets a flag so that if `FT_Render_Glyph' is called with
`FT_RENDER_MODE_NORMAL' (or `FT_Load_Glyph' with
`FT_LOAD_RENDER'), a default blending of the color glyph layers
will happen automatically for convenience.
- As a GSoC 2018 project, Nikhil Ramakrishnan completely
overhauled and modernized the API reference.
II. MISCELLANEOUS
- The logic for computing the global ascender, descender, and
height of OpenType fonts has been slightly adjusted for
consistency.
. If the `useTypoMetrics' flag (i.e., bit 7 in the `fsSelection'
field) in the `OS/2' table is set, use the `sTypo' fields in
`OS/2' unconditionally.
. Otherwise use the metrics data from the `hhea' table (if not
zero).
. Otherwise use the `sTypo' fields from the `OS/2' table (if not
zero).
. Otherwise use the `usWin' data from the `OS/2' table as a last
resort.
Variable fonts will apply the `MVAR' deltas to whichever metrics
were picked.
- `TT_Set_MM_Blend' could fail if call repeatedly with the same
arguments.
- The precision of handling deltas in Variation Fonts has been
increased. The problem did only show up with multidimensional
designspaces.
- New function `FT_Library_SetLcdGeometry' to set up the geometry
of LCD subpixels.
- FreeType now uses the `defaultChar' property of PCF fonts to set
the glyph for the undefined character at glyph index 0 (as
FreeType already does for all other supported font formats). As
a consequence, the order of glyphs of a PCF font if accessed
with FreeType can be different now compared to previous
versions.
This change doesn't affect PCF font access with cmaps.
- `FT_Select_Charmap' has been changed to allow parameter value
`FT_ENCODING_NONE', which is valid for BDF, PCF, and Windows FNT
formats to access built-in cmaps that don't have a predefined
`FT_Encoding' value.
- A previously reserved field in the `FT_GlyphSlotRec' structure
now holds the glyph index.
- On Win32 platforms, the use of `_DLL' to build the library has
been replaced with `DLL_EXPORT' and `DLL_IMPORT'.
- The usual round of fuzzer bug fixes to better reject malformed
fonts.
- `FT_Outline_New_Internal' and `FT_Outline_Done_Internal' have
been removed. These two functions were public by oversight only
and were never documented.
- A new function `FT_Error_String' returns descriptions of error
codes if configuration macro FT_CONFIG_OPTION_ERROR_STRINGS is
defined.
- `FT_Set_MM_WeightVector' and `FT_Get_MM_WeightVector' are new
functions limited to Adobe MultiMaster fonts to directly set and
get the weight vector.
- Support for Position Independent Code as needed by systems that
prohibit automatic address fixups, such as BREW, has been
removed. [Compilation with modern compilers that use flags like
`-fPIC' or `-fPIE' is not affected.]
- The `ftdump' demo program has new options `-c' and `-C' to
display charmaps in compact and detailed format, respectively.
Option `-V' has been removed.
- The `ftview', `ftstring', and `ftgrid' demo programs use a new
command line option `-d' to specify the program window's width,
height, and color depth.
- The `ftview' demo program now displays red boxes for zero-width
glyphs.
- `ftglyph' has limited support to display fonts with
color-layered glyphs. This will be improved later on.
- `ftgrid' can now display bitmap fonts also.
- The `ttdebug' demo program has a new option `-f' to select a
member of a TrueType collection (TTC).
- Other various improvements to the demo programs.
======================================================================
CHANGES BETWEEN 2.9 and 2.9.1
I. IMPORTANT BUG FIXES
@ -8,7 +189,7 @@ CHANGES BETWEEN 2.9 and 2.9.1
- CVE-2018-6942: Older FreeType versions can crash with certain
malformed variation fonts.
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6942
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6942
II. MISCELLANEOUS
@ -232,7 +413,7 @@ CHANGES BETWEEN 2.7.1 and 2.8
following properties can be handled: stem darkening, LCD filter
weights, and the random seed for the `random' CFF operator.
- The PCF change to show more `colourful' family names (introduced
- The PCF change to show more `colorful' family names (introduced
in version 2.7.1) was too radical; it can now be configured with
PCF_CONFIG_OPTION_LONG_FAMILY_NAMES at compile time. If
activated, it can be switched off at run time with the new pcf
@ -383,7 +564,7 @@ CHANGES BETWEEN 2.7 and 2.7.1
and the number of CVT entries. Please report if you encounter a
font where the selected values are not adequate.
- PCF family names are made more `colourful'; they now include the
- PCF family names are made more `colorful'; they now include the
foundry and information whether they contain wide characters.
For example, you no longer get `Fixed' but rather `Sony Fixed'
or `Misc Fixed Wide'.
@ -667,8 +848,8 @@ CHANGES BETWEEN 2.6.1 and 2.6.2
- The `ftstring' demo program now supports subpixel rendering; use
key `l' to cycle through the LCD modes.
- The `ftstring' demo program now supports colour rendering; use
the `space' key to cycle through various colour combinations.
- The `ftstring' demo program now supports color rendering; use
the `space' key to cycle through various color combinations.
- The graphical demo programs now use a default gamma value of 1.8
(instead of 1.2).
@ -1325,7 +1506,7 @@ CHANGES BETWEEN 2.4.10 and 2.4.11
Originally, it was a separate patch available from
http://www.infinality.net/blog/
https://web.archive.org/web/20150710073951/http://www.infinality.net:80/blog/
and which has been integrated.
@ -4047,7 +4228,7 @@ CHANGES BETWEEN beta8 and 2.0
untested for now.
- Updated `docs/docmaker.py', a draft API reference is available at
http://www.freetype.org/ft2api.html.
https://web.archive.org/web/20001215173400/http://www.freetype.org:80/ft2api.html.
- Changed `type1' to use `psaux'.
@ -5017,7 +5198,7 @@ Extensions support:
------------------------------------------------------------------------
Copyright 2000-2018 by
Copyright (C) 2000-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -139,7 +139,7 @@ IV. Overriding default configuration and module headers
----------------------------------------------------------------------
Copyright 2003-2018 by
Copyright (C) 2003-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -88,14 +88,13 @@ debugging its code:
for example as in
#undef FT_COMPONENT
#define FT_COMPONENT trace_io
#define FT_COMPONENT io
The value of the FT_COMPONENT macro is an enumeration named
`trace_XXXX' where `XXXX' is one of the component names defined in
the internal file `internal/fttrace.h'. If you modify FreeType
source and insert new `trace_XXXX' macro, you must register it in
`fttrace.h'. If you insert or remove many trace macros, you can
check the undefined or the unused trace macro by
The value of the FT_COMPONENT macro is one of the component
names defined in the internal file `internal/fttrace.h'. If you
modify FreeType source and insert new FT_COMPONENT macro, you must
register it in `fttrace.h'. If you insert or remove many trace
macros, you can check the undefined or the unused trace macro by
`src/tools/chktrcmp.py'.
Each such component is assigned a `debug level', ranging from 0 to
@ -138,8 +137,8 @@ behaviour of FreeType at runtime.
component1:level1 component2:level2 component3:level3 ...
where `componentX' is the name of a tracing component, as defined
in `fttrace.h', but without the `trace_' prefix. `levelX' is the
corresponding level to use at runtime.
in `fttrace.h'. `levelX' is the corresponding level to use at
runtime.
`any' is a special component name that will be interpreted as
`any/all components'. For example, the following definitions
@ -191,7 +190,7 @@ behaviour of FreeType at runtime.
------------------------------------------------------------------------
Copyright 2002-2018 by
Copyright (C) 2002-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -27,7 +27,7 @@ Other bugs have been registered at the savannah bugzilla of FreeType.
------------------------------------------------------------------------
Copyright 2001-2018 by
Copyright (C) 2001-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -1,39 +1,38 @@
/***************************************************************************/
/* */
/* ftconfig.h */
/* */
/* ANSI-specific configuration file (specification only). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftconfig.h
*
* ANSI-specific configuration file (specification only).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* This header file contains a number of macro definitions that are used */
/* by the rest of the engine. Most of the macros here are automatically */
/* determined at compile time, and you should not need to change it to */
/* port FreeType, except to compile the library with a non-ANSI */
/* compiler. */
/* */
/* Note however that if some specific modifications are needed, we */
/* advise you to place a modified copy in your build directory. */
/* */
/* The build directory is usually `builds/<system>', and contains */
/* system-specific files that are always included first when building */
/* the library. */
/* */
/* This ANSI version should stay in `include/config/'. */
/* */
/*************************************************************************/
/**************************************************************************
*
* This header file contains a number of macro definitions that are used by
* the rest of the engine. Most of the macros here are automatically
* determined at compile time, and you should not need to change it to port
* FreeType, except to compile the library with a non-ANSI compiler.
*
* Note however that if some specific modifications are needed, we advise
* you to place a modified copy in your build directory.
*
* The build directory is usually `builds/<system>`, and contains
* system-specific files that are always included first when building the
* library.
*
* This ANSI version should stay in `include/config/`.
*
*/
#ifndef FTCONFIG_H_
#define FTCONFIG_H_
@ -46,32 +45,32 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* PLATFORM-SPECIFIC CONFIGURATION MACROS */
/* */
/* These macros can be toggled to suit a specific system. The current */
/* ones are defaults used to compile FreeType in an ANSI C environment */
/* (16bit compilers are also supported). Copy this file to your own */
/* `builds/<system>' directory, and edit it to port the engine. */
/* */
/*************************************************************************/
/**************************************************************************
*
* PLATFORM-SPECIFIC CONFIGURATION MACROS
*
* These macros can be toggled to suit a specific system. The current ones
* are defaults used to compile FreeType in an ANSI C environment (16bit
* compilers are also supported). Copy this file to your own
* `builds/<system>` directory, and edit it to port the engine.
*
*/
/* There are systems (like the Texas Instruments 'C54x) where a `char' */
/* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
/* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
/* is probably unexpected. */
/* */
/* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
/* `char' type. */
/* There are systems (like the Texas Instruments 'C54x) where a `char` */
/* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
/* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
/* is probably unexpected. */
/* */
/* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
/* `char` type. */
#ifndef FT_CHAR_BIT
#define FT_CHAR_BIT CHAR_BIT
#endif
/* The size of an `int' type. */
/* The size of an `int` type. */
#if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
#elif FT_UINT_MAX == 0xFFFFFFFFUL
@ -82,7 +81,7 @@ FT_BEGIN_HEADER
#error "Unsupported size of `int' type!"
#endif
/* The size of a `long' type. A five-byte `long' (as used e.g. on the */
/* The size of a `long` type. A five-byte `long` (as used e.g. on the */
/* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
@ -95,35 +94,35 @@ FT_BEGIN_HEADER
#endif
/* FT_UNUSED is a macro used to indicate that a given parameter is not */
/* used -- this is only used to get rid of unpleasant compiler warnings */
/* `FT_UNUSED` indicates that a given parameter is not used -- */
/* this is only used to get rid of unpleasant compiler warnings. */
#ifndef FT_UNUSED
#define FT_UNUSED( arg ) ( (arg) = (arg) )
#endif
/*************************************************************************/
/* */
/* AUTOMATIC CONFIGURATION MACROS */
/* */
/* These macros are computed from the ones defined above. Don't touch */
/* their definition, unless you know precisely what you are doing. No */
/* porter should need to mess with them. */
/* */
/*************************************************************************/
/**************************************************************************
*
* AUTOMATIC CONFIGURATION MACROS
*
* These macros are computed from the ones defined above. Don't touch
* their definition, unless you know precisely what you are doing. No
* porter should need to mess with them.
*
*/
/*************************************************************************/
/* */
/* Mac support */
/* */
/* This is the only necessary change, so it is defined here instead */
/* providing a new configuration file. */
/* */
/**************************************************************************
*
* Mac support
*
* This is the only necessary change, so it is defined here instead
* providing a new configuration file.
*/
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */
/* AvailabilityMacros.h is available since Mac OS X 10.2, */
/* so guess the system version by maximum errno before inclusion */
/* No Carbon frameworks for 64bit 10.4.x. */
/* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
/* so guess the system version by maximum errno before inclusion. */
#include <errno.h>
#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h"
@ -143,7 +142,7 @@ FT_BEGIN_HEADER
#endif
/* Fix compiler warning with sgi compiler */
/* Fix compiler warning with sgi compiler. */
#if defined( __sgi ) && !defined( __GNUC__ )
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
#pragma set woff 3505
@ -151,33 +150,33 @@ FT_BEGIN_HEADER
#endif
/*************************************************************************/
/* */
/* <Section> */
/* basic_types */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* basic_types
*
*/
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int16 */
/* */
/* <Description> */
/* A typedef for a 16bit signed integer type. */
/* */
/**************************************************************************
*
* @type:
* FT_Int16
*
* @description:
* A typedef for a 16bit signed integer type.
*/
typedef signed short FT_Int16;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt16 */
/* */
/* <Description> */
/* A typedef for a 16bit unsigned integer type. */
/* */
/**************************************************************************
*
* @type:
* FT_UInt16
*
* @description:
* A typedef for a 16bit unsigned integer type.
*/
typedef unsigned short FT_UInt16;
/* */
@ -186,50 +185,50 @@ FT_BEGIN_HEADER
/* this #if 0 ... #endif clause is for documentation purposes */
#if 0
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int32 */
/* */
/* <Description> */
/* A typedef for a 32bit signed integer type. The size depends on */
/* the configuration. */
/* */
/**************************************************************************
*
* @type:
* FT_Int32
*
* @description:
* A typedef for a 32bit signed integer type. The size depends on the
* configuration.
*/
typedef signed XXX FT_Int32;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt32 */
/* */
/* A typedef for a 32bit unsigned integer type. The size depends on */
/* the configuration. */
/* */
/**************************************************************************
*
* @type:
* FT_UInt32
*
* A typedef for a 32bit unsigned integer type. The size depends on the
* configuration.
*/
typedef unsigned XXX FT_UInt32;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int64 */
/* */
/* A typedef for a 64bit signed integer type. The size depends on */
/* the configuration. Only defined if there is real 64bit support; */
/* otherwise, it gets emulated with a structure (if necessary). */
/* */
/**************************************************************************
*
* @type:
* FT_Int64
*
* A typedef for a 64bit signed integer type. The size depends on the
* configuration. Only defined if there is real 64bit support;
* otherwise, it gets emulated with a structure (if necessary).
*/
typedef signed XXX FT_Int64;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt64 */
/* */
/* A typedef for a 64bit unsigned integer type. The size depends on */
/* the configuration. Only defined if there is real 64bit support; */
/* otherwise, it gets emulated with a structure (if necessary). */
/* */
/**************************************************************************
*
* @type:
* FT_UInt64
*
* A typedef for a 64bit unsigned integer type. The size depends on the
* configuration. Only defined if there is real 64bit support;
* otherwise, it gets emulated with a structure (if necessary).
*/
typedef unsigned XXX FT_UInt64;
/* */
@ -251,7 +250,7 @@ FT_BEGIN_HEADER
#endif
/* look up an integer type that is at least 32 bits */
/* look up an integer type that is at least 32~bits */
#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
typedef int FT_Fast;
@ -265,22 +264,22 @@ FT_BEGIN_HEADER
#endif
/* determine whether we have a 64-bit int type for platforms without */
/* Autoconf */
/* determine whether we have a 64-bit `int` type for platforms without */
/* Autoconf */
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
/* FT_LONG64 must be defined if a 64-bit type is available */
/* `FT_LONG64` must be defined if a 64-bit type is available */
#define FT_LONG64
#define FT_INT64 long
#define FT_UINT64 unsigned long
/*************************************************************************/
/* */
/* A 64-bit data type may create compilation problems if you compile */
/* in strict ANSI mode. To avoid them, we disable other 64-bit data */
/* types if __STDC__ is defined. You can however ignore this rule */
/* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
/* */
/**************************************************************************
*
* A 64-bit data type may create compilation problems if you compile in
* strict ANSI mode. To avoid them, we disable other 64-bit data types if
* `__STDC__` is defined. You can however ignore this rule by defining the
* `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
*/
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
@ -289,19 +288,19 @@ FT_BEGIN_HEADER
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* this compiler provides the __int64 type */
/* this compiler provides the `__int64` type */
#define FT_LONG64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
#elif defined( __BORLANDC__ ) /* Borland C++ */
/* XXXX: We should probably check the value of __BORLANDC__ in order */
/* to test the compiler version. */
/* XXXX: We should probably check the value of `__BORLANDC__` in order */
/* to test the compiler version. */
/* this compiler provides the __int64 type */
/* this compiler provides the `__int64` type */
#define FT_LONG64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
@ -318,7 +317,7 @@ FT_BEGIN_HEADER
#elif defined( __GNUC__ )
/* GCC provides the `long long' type */
/* GCC provides the `long long` type */
#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
@ -342,11 +341,11 @@ FT_BEGIN_HEADER
#endif
/*************************************************************************/
/* */
/* miscellaneous */
/* */
/*************************************************************************/
/**************************************************************************
*
* miscellaneous
*
*/
#define FT_BEGIN_STMNT do {
@ -354,7 +353,7 @@ FT_BEGIN_HEADER
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
/* typeof condition taken from gnulib's `intprops.h' header file */
/* `typeof` condition taken from gnulib's `intprops.h` header file */
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
defined( __IBM__TYPEOF__ ) ) || \
@ -365,14 +364,14 @@ FT_BEGIN_HEADER
#endif
/* Use FT_LOCAL and FT_LOCAL_DEF to declare and define, respectively, */
/* a function that gets used only within the scope of a module. */
/* Normally, both the header and source code files for such a */
/* function are within a single module directory. */
/* */
/* Intra-module arrays should be tagged with FT_LOCAL_ARRAY and */
/* FT_LOCAL_ARRAY_DEF. */
/* */
/* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
/* respectively, a function that gets used only within the scope of a */
/* module. Normally, both the header and source code files for such a */
/* function are within a single module directory. */
/* */
/* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
/* `FT_LOCAL_ARRAY_DEF`. */
/* */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x
@ -394,12 +393,12 @@ FT_BEGIN_HEADER
#define FT_LOCAL_ARRAY_DEF( x ) const x
/* Use FT_BASE and FT_BASE_DEF to declare and define, respectively, */
/* functions that are used in more than a single module. In the */
/* current setup this implies that the declaration is in a header */
/* file in the `include/freetype/internal' directory, and the */
/* function body is in a file in `src/base'. */
/* */
/* Use `FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, */
/* functions that are used in more than a single module. In the */
/* current setup this implies that the declaration is in a header file */
/* in the `include/freetype/internal` directory, and the function body */
/* is in a file in `src/base`. */
/* */
#ifndef FT_BASE
#ifdef __cplusplus
@ -422,45 +421,50 @@ FT_BEGIN_HEADER
#endif /* !FT_BASE_DEF */
/* When compiling FreeType as a DLL or DSO with hidden visibility */
/* some systems/compilers need a special attribute in front OR after */
/* the return type of function declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. */
/* */
/* To export a variable, use FT_EXPORT_VAR. */
/* */
/* When compiling FreeType as a DLL or DSO with hidden visibility */
/* some systems/compilers need a special attribute in front OR after */
/* the return type of function declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
/* */
/* - `FT_EXPORT( return_type )` */
/* */
/* is used in a function declaration, as in */
/* */
/* ``` */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* ``` */
/* */
/* - `FT_EXPORT_DEF( return_type )` */
/* */
/* is used in a function definition, as in */
/* */
/* ``` */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* ``` */
/* */
/* You can provide your own implementation of `FT_EXPORT` and */
/* `FT_EXPORT_DEF` here if you want. */
/* */
/* To export a variable, use `FT_EXPORT_VAR`. */
/* */
#ifndef FT_EXPORT
#ifdef FT2_BUILD_LIBRARY
#if defined( _WIN32 ) && ( defined( _DLL ) || defined( DLL_EXPORT ) )
#if defined( _WIN32 ) && defined( DLL_EXPORT )
#define FT_EXPORT( x ) __declspec( dllexport ) x
#elif defined( __GNUC__ ) && __GNUC__ >= 4
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
#define FT_EXPORT( x ) __global x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
@ -469,7 +473,7 @@ FT_BEGIN_HEADER
#else
#if defined( FT2_DLLIMPORT )
#if defined( _WIN32 ) && defined( DLL_IMPORT )
#define FT_EXPORT( x ) __declspec( dllimport ) x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
@ -508,7 +512,7 @@ FT_BEGIN_HEADER
/* C++ compiler and with 16bit compilers. */
/* */
/* This is special. Within C++, you must specify `extern "C"' for */
/* This is special. Within C++, you must specify `extern "C"` for */
/* functions which are used via function pointers, and you also */
/* must do that for structures which contain function pointers to */
/* assure C linkage -- it's not possible to have (local) anonymous */
@ -531,7 +535,7 @@ FT_BEGIN_HEADER
/* */
/* */
/* Some 16bit compilers have to redefine these macros to insert */
/* the infamous `_cdecl' or `__fastcall' declarations. */
/* the infamous `_cdecl` or `__fastcall` declarations. */
/* */
#ifndef FT_CALLBACK_DEF
#ifdef __cplusplus

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftheader.h */
/* */
/* Build macros of the FreeType 2 library. */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftheader.h
*
* Build macros of the FreeType 2 library.
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTHEADER_H_
#define FTHEADER_H_
@ -27,7 +27,7 @@
/* <Description> */
/* This macro is used in association with @FT_END_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* encapsulated in an `extern "C" { .. }` block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
@ -45,7 +45,7 @@
/* <Description> */
/* This macro is used in association with @FT_BEGIN_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* encapsulated in an `extern "C" { .. }` block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
@ -55,54 +55,54 @@
#endif
/*************************************************************************/
/* */
/* Aliases for the FreeType 2 public and configuration files. */
/* */
/*************************************************************************/
/**************************************************************************
*
* Aliases for the FreeType 2 public and configuration files.
*
*/
/*************************************************************************/
/* */
/* <Section> */
/* header_file_macros */
/* */
/* <Title> */
/* Header File Macros */
/* */
/* <Abstract> */
/* Macro definitions used to #include specific header files. */
/* */
/* <Description> */
/* The following macros are defined to the name of specific */
/* FreeType~2 header files. They can be used directly in #include */
/* statements as in: */
/* */
/* { */
/* #include FT_FREETYPE_H */
/* #include FT_MULTIPLE_MASTERS_H */
/* #include FT_GLYPH_H */
/* } */
/* */
/* There are several reasons why we are now using macros to name */
/* public header files. The first one is that such macros are not */
/* limited to the infamous 8.3~naming rule required by DOS (and */
/* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
/* */
/* The second reason is that it allows for more flexibility in the */
/* way FreeType~2 is installed on a given system. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* header_file_macros
*
* @title:
* Header File Macros
*
* @abstract:
* Macro definitions used to `#include` specific header files.
*
* @description:
* The following macros are defined to the name of specific FreeType~2
* header files. They can be used directly in `#include` statements as
* in:
*
* ```
* #include FT_FREETYPE_H
* #include FT_MULTIPLE_MASTERS_H
* #include FT_GLYPH_H
* ```
*
* There are several reasons why we are now using macros to name public
* header files. The first one is that such macros are not limited to
* the infamous 8.3~naming rule required by DOS (and
* `FT_MULTIPLE_MASTERS_H` is a lot more meaningful than `ftmm.h`).
*
* The second reason is that it allows for more flexibility in the way
* FreeType~2 is installed on a given system.
*
*/
/* configuration files */
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CONFIG_CONFIG_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* FreeType~2 configuration data.
*
*/
@ -111,13 +111,13 @@
#endif
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CONFIG_STANDARD_LIBRARY_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* FreeType~2 interface to the standard C library functions.
*
*/
@ -126,13 +126,13 @@
#endif
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CONFIG_OPTIONS_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* FreeType~2 project-specific configuration options.
*
*/
@ -141,13 +141,13 @@
#endif
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CONFIG_MODULES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* list of FreeType~2 modules that are statically linked to new library
* instances in @FT_Init_FreeType.
*
@ -160,26 +160,26 @@
/* public headers */
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_FREETYPE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* base FreeType~2 API.
*
*/
#define FT_FREETYPE_H <freetype/freetype.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* list of FreeType~2 error codes (and messages).
*
* It is included by @FT_FREETYPE_H.
@ -188,26 +188,26 @@
#define FT_ERRORS_H <freetype/fterrors.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_MODULE_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* list of FreeType~2 module error offsets (and messages).
*
*/
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_SYSTEM_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 interface to low-level operations (i.e., memory management
* and stream i/o).
*
@ -217,13 +217,13 @@
#define FT_SYSTEM_H <freetype/ftsystem.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_IMAGE_H
*
* @description:
* A macro used in #include statements to name the file containing type
* A macro used in `#include` statements to name the file containing type
* definitions related to glyph images (i.e., bitmaps, outlines,
* scan-converter parameters).
*
@ -233,13 +233,13 @@
#define FT_IMAGE_H <freetype/ftimage.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TYPES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* basic data types defined by FreeType~2.
*
* It is included by @FT_FREETYPE_H.
@ -248,13 +248,13 @@
#define FT_TYPES_H <freetype/fttypes.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_LIST_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* list management API of FreeType~2.
*
* (Most applications will never need to include this file.)
@ -263,151 +263,151 @@
#define FT_LIST_H <freetype/ftlist.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_OUTLINE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* scalable outline management API of FreeType~2.
*
*/
#define FT_OUTLINE_H <freetype/ftoutln.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_SIZES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API which manages multiple @FT_Size objects per face.
*
*/
#define FT_SIZES_H <freetype/ftsizes.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_MODULE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* module management API of FreeType~2.
*
*/
#define FT_MODULE_H <freetype/ftmodapi.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_RENDER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* renderer module management API of FreeType~2.
*
*/
#define FT_RENDER_H <freetype/ftrender.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the driver modules.
*
*/
#define FT_DRIVER_H <freetype/ftdriver.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_AUTOHINTER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the auto-hinting module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_AUTOHINTER_H FT_DRIVER_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CFF_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the CFF driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_CFF_DRIVER_H FT_DRIVER_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRUETYPE_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the TrueType driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_TRUETYPE_DRIVER_H FT_DRIVER_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_PCF_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the PCF driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_PCF_DRIVER_H FT_DRIVER_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TYPE1_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* types and API specific to the Type~1 format.
*
*/
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRUETYPE_IDS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* enumeration values which identify name strings, languages, encodings,
* etc. This file really contains a _large_ set of constant macro
* definitions, taken from the TrueType and OpenType specifications.
@ -416,174 +416,172 @@
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRUETYPE_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* types and API specific to the TrueType (as well as OpenType) format.
*
*/
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRUETYPE_TAGS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of TrueType four-byte `tags' which identify blocks in
* A macro used in `#include` statements to name the file containing the
* definitions of TrueType four-byte 'tags' which identify blocks in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_BDF_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which accesses BDF-specific strings from a
* face.
* A macro used in `#include` statements to name the file containing the
* definitions of an API which accesses BDF-specific strings from a face.
*
*/
#define FT_BDF_H <freetype/ftbdf.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CID_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which access CID font information from a
* face.
* A macro used in `#include` statements to name the file containing the
* definitions of an API which access CID font information from a face.
*
*/
#define FT_CID_H <freetype/ftcid.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_GZIP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* definitions of an API which supports gzip-compressed files.
*
*/
#define FT_GZIP_H <freetype/ftgzip.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_LZW_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* definitions of an API which supports LZW-compressed files.
*
*/
#define FT_LZW_H <freetype/ftlzw.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_BZIP2_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* definitions of an API which supports bzip2-compressed files.
*
*/
#define FT_BZIP2_H <freetype/ftbzip2.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_WINFONTS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* definitions of an API which supports Windows FNT files.
*
*/
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_GLYPH_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API of the optional glyph management component.
*
*/
#define FT_GLYPH_H <freetype/ftglyph.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_BITMAP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API of the optional bitmap conversion component.
*
*/
#define FT_BITMAP_H <freetype/ftbitmap.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_BBOX_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API of the optional exact bounding box computation routines.
*
*/
#define FT_BBOX_H <freetype/ftbbox.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CACHE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API of the optional FreeType~2 cache sub-system.
*
*/
#define FT_CACHE_H <freetype/ftcache.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_MAC_H
*
* @description:
* A macro used in #include statements to name the file containing the
* Macintosh-specific FreeType~2 API. The latter is used to access
* fonts embedded in resource forks.
* A macro used in `#include` statements to name the file containing the
* Macintosh-specific FreeType~2 API. The latter is used to access fonts
* embedded in resource forks.
*
* This header file must be explicitly included by client applications
* compiled on the Mac (note that the base API still works though).
@ -592,105 +590,105 @@
#define FT_MAC_H <freetype/ftmac.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_MULTIPLE_MASTERS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* optional multiple-masters management API of FreeType~2.
*
*/
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_SFNT_NAMES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which accesses embedded `name' strings in
* A macro used in `#include` statements to name the file containing the
* optional FreeType~2 API which accesses embedded 'name' strings in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_OPENTYPE_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
* GPOS, GSUB, JSTF).
* A macro used in `#include` statements to name the file containing the
* optional FreeType~2 API which validates OpenType tables ('BASE',
* 'GDEF', 'GPOS', 'GSUB', 'JSTF').
*
*/
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_GX_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
* mort, morx, bsln, just, kern, opbd, trak, prop).
* A macro used in `#include` statements to name the file containing the
* optional FreeType~2 API which validates TrueTypeGX/AAT tables ('feat',
* 'mort', 'morx', 'bsln', 'just', 'kern', 'opbd', 'trak', 'prop').
*
*/
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_PFR_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which accesses PFR-specific data.
*
*/
#define FT_PFR_H <freetype/ftpfr.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_STROKER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which provides functions to stroke outline paths.
*/
#define FT_STROKER_H <freetype/ftstroke.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_SYNTHESIS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs artificial obliquing and emboldening.
*/
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_FONT_FORMATS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which provides functions specific to font formats.
*/
#define FT_FONT_FORMATS_H <freetype/ftfntfmt.h>
@ -699,67 +697,79 @@
#define FT_XFREE86_H FT_FONT_FORMATS_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRIGONOMETRY_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs trigonometric computations (e.g.,
* cosines and arc tangents).
*/
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_LCD_FILTER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_INCREMENTAL_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs incremental glyph loading.
*/
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_GASP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which returns entries from the TrueType GASP table.
*/
#define FT_GASP_H <freetype/ftgasp.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_ADVANCES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which returns individual and ranged glyph advances.
*/
#define FT_ADVANCES_H <freetype/ftadvanc.h>
/**************************************************************************
*
* @macro:
* FT_COLOR_H
*
* @description:
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which handles the OpenType 'CPAL' table.
*/
#define FT_COLOR_H <freetype/ftcolor.h>
/* */
/* These header files don't need to be included by the user. */
@ -770,14 +780,14 @@
#define FT_UNPATENTED_HINTING_H <freetype/ftparams.h>
#define FT_TRUETYPE_UNPATENTED_H <freetype/ftparams.h>
/* FT_CACHE_H is the only header file needed for the cache subsystem. */
/* `FT_CACHE_H` is the only header file needed for the cache subsystem. */
#define FT_CACHE_IMAGE_H FT_CACHE_H
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
#define FT_CACHE_CHARMAP_H FT_CACHE_H
/* The internals of the cache sub-system are no longer exposed. We */
/* default to FT_CACHE_H at the moment just in case, but we know of */
/* no rogue client that uses them. */
/* default to `FT_CACHE_H` at the moment just in case, but we know */
/* of no rogue client that uses them. */
/* */
#define FT_CACHE_MANAGER_H FT_CACHE_H
#define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H
@ -789,8 +799,8 @@
/*
* Include internal headers definitions from <internal/...>
* only when building the library.
* Include internal headers definitions from `<internal/...>` only when
* building the library.
*/
#ifdef FT2_BUILD_LIBRARY
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>

View File

@ -1,12 +1,12 @@
/*
* This file registers the FreeType modules compiled into the library.
* This file registers the FreeType modules compiled into the library.
*
* If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/') based on information
* from `<topdir>/modules.cfg'.
* If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/`) based on information
* from `<topdir>/modules.cfg`.
*
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
* FreeType without GNU make.
* Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile
* FreeType without GNU make.
*
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,31 @@
/***************************************************************************/
/* */
/* ftstdlib.h */
/* */
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftstdlib.h
*
* ANSI-specific library and header configuration file (specification
* only).
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* This file is used to group all #includes to the ANSI C library that */
/* FreeType normally requires. It also defines macros to rename the */
/* standard functions within the FreeType source code. */
/* */
/* Load a file which defines FTSTDLIB_H_ before this one to override it. */
/* */
/*************************************************************************/
/**************************************************************************
*
* This file is used to group all `#includes` to the ANSI~C library that
* FreeType normally requires. It also defines macros to rename the
* standard functions within the FreeType source code.
*
* Load a file which defines `FTSTDLIB_H_` before this one to override it.
*
*/
#ifndef FTSTDLIB_H_
@ -37,23 +37,23 @@
#define ft_ptrdiff_t ptrdiff_t
/**********************************************************************/
/* */
/* integer limits */
/* */
/* UINT_MAX and ULONG_MAX are used to automatically compute the size */
/* of `int' and `long' in bytes at compile-time. So far, this works */
/* for all platforms the library has been tested on. */
/* */
/* Note that on the extremely rare platforms that do not provide */
/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
/* old Crays where `int' is 36 bits), we do not make any guarantee */
/* about the correct behaviour of FT2 with all fonts. */
/* */
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
/* message like `couldn't find 32-bit type' or something similar. */
/* */
/**********************************************************************/
/**************************************************************************
*
* integer limits
*
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
* `int` and `long` in bytes at compile-time. So far, this works for all
* platforms the library has been tested on.
*
* Note that on the extremely rare platforms that do not provide integer
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
* `int` is 36~bits), we do not make any guarantee about the correct
* behaviour of FreeType~2 with all fonts.
*
* In these cases, `ftconfig.h` will refuse to compile anyway with a
* message like 'couldn't find 32-bit type' or something similar.
*
*/
#include <limits.h>
@ -68,11 +68,11 @@
#define FT_ULONG_MAX ULONG_MAX
/**********************************************************************/
/* */
/* character and string processing */
/* */
/**********************************************************************/
/**************************************************************************
*
* character and string processing
*
*/
#include <string.h>
@ -92,11 +92,11 @@
#define ft_strstr strstr
/**********************************************************************/
/* */
/* file handling */
/* */
/**********************************************************************/
/**************************************************************************
*
* file handling
*
*/
#include <stdio.h>
@ -110,11 +110,11 @@
#define ft_sprintf sprintf
/**********************************************************************/
/* */
/* sorting */
/* */
/**********************************************************************/
/**************************************************************************
*
* sorting
*
*/
#include <stdlib.h>
@ -122,11 +122,11 @@
#define ft_qsort qsort
/**********************************************************************/
/* */
/* memory allocation */
/* */
/**********************************************************************/
/**************************************************************************
*
* memory allocation
*
*/
#define ft_scalloc calloc
@ -135,36 +135,36 @@
#define ft_srealloc realloc
/**********************************************************************/
/* */
/* miscellaneous */
/* */
/**********************************************************************/
/**************************************************************************
*
* miscellaneous
*
*/
#define ft_strtol strtol
#define ft_getenv getenv
/**********************************************************************/
/* */
/* execution control */
/* */
/**********************************************************************/
/**************************************************************************
*
* execution control
*
*/
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* jmp_buf is defined as a macro */
/* on certain platforms */
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* `jmp_buf` is defined as a macro */
/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
/* the following is only used for debugging purposes, i.e., if */
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
/* The following is only used for debugging purposes, i.e., if */
/* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */
#include <stdarg.h>

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftadvanc.h */
/* */
/* Quick computation of advance widths (specification only). */
/* */
/* Copyright 2008-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftadvanc.h
*
* Quick computation of advance widths (specification only).
*
* Copyright (C) 2008-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTADVANC_H_
@ -56,68 +56,67 @@ FT_BEGIN_HEADER
*/
/*************************************************************************/
/* */
/* <Const> */
/* FT_ADVANCE_FLAG_FAST_ONLY */
/* */
/* <Description> */
/* A bit-flag to be OR-ed with the `flags' parameter of the */
/* @FT_Get_Advance and @FT_Get_Advances functions. */
/* */
/* If set, it indicates that you want these functions to fail if the */
/* corresponding hinting mode or font driver doesn't allow for very */
/* quick advance computation. */
/* */
/* Typically, glyphs that are either unscaled, unhinted, bitmapped, */
/* or light-hinted can have their advance width computed very */
/* quickly. */
/* */
/* Normal and bytecode hinted modes that require loading, scaling, */
/* and hinting of the glyph outline, are extremely slow by */
/* comparison. */
/* */
/**************************************************************************
*
* @enum:
* FT_ADVANCE_FLAG_FAST_ONLY
*
* @description:
* A bit-flag to be OR-ed with the `flags` parameter of the
* @FT_Get_Advance and @FT_Get_Advances functions.
*
* If set, it indicates that you want these functions to fail if the
* corresponding hinting mode or font driver doesn't allow for very quick
* advance computation.
*
* Typically, glyphs that are either unscaled, unhinted, bitmapped, or
* light-hinted can have their advance width computed very quickly.
*
* Normal and bytecode hinted modes that require loading, scaling, and
* hinting of the glyph outline, are extremely slow by comparison.
*/
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Advance */
/* */
/* <Description> */
/* Retrieve the advance value of a given glyph outline in an */
/* @FT_Face. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
/* */
/* gindex :: The glyph index. */
/* */
/* load_flags :: A set of bit flags similar to those used when */
/* calling @FT_Load_Glyph, used to determine what kind */
/* of advances you need. */
/* <Output> */
/* padvance :: The advance value. If scaling is performed (based on */
/* the value of `load_flags'), the advance value is in */
/* 16.16 format. Otherwise, it is in font units. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
/* vertical advance corresponding to a vertical layout. */
/* Otherwise, it is the horizontal advance in a */
/* horizontal layout. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */
/* */
/* A scaled advance is returned in 16.16 format but isn't transformed */
/* by the affine transformation specified by @FT_Set_Transform. */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Advance
*
* @description:
* Retrieve the advance value of a given glyph outline in an @FT_Face.
*
* @input:
* face ::
* The source @FT_Face handle.
*
* gindex ::
* The glyph index.
*
* load_flags ::
* A set of bit flags similar to those used when calling
* @FT_Load_Glyph, used to determine what kind of advances you need.
* @output:
* padvance ::
* The advance value. If scaling is performed (based on the value of
* `load_flags`), the advance value is in 16.16 format. Otherwise, it
* is in font units.
*
* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance
* corresponding to a vertical layout. Otherwise, it is the horizontal
* advance in a horizontal layout.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
* the corresponding font backend doesn't have a quick way to retrieve
* the advances.
*
* A scaled advance is returned in 16.16 format but isn't transformed by
* the affine transformation specified by @FT_Set_Transform.
*/
FT_EXPORT( FT_Error )
FT_Get_Advance( FT_Face face,
FT_UInt gindex,
@ -125,50 +124,52 @@ FT_BEGIN_HEADER
FT_Fixed *padvance );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Advances */
/* */
/* <Description> */
/* Retrieve the advance values of several glyph outlines in an */
/* @FT_Face. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
/* */
/* start :: The first glyph index. */
/* */
/* count :: The number of advance values you want to retrieve. */
/* */
/* load_flags :: A set of bit flags similar to those used when */
/* calling @FT_Load_Glyph. */
/* */
/* <Output> */
/* padvance :: The advance values. This array, to be provided by the */
/* caller, must contain at least `count' elements. */
/* */
/* If scaling is performed (based on the value of */
/* `load_flags'), the advance values are in 16.16 format. */
/* Otherwise, they are in font units. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
/* vertical advances corresponding to a vertical layout. */
/* Otherwise, they are the horizontal advances in a */
/* horizontal layout. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */
/* */
/* Scaled advances are returned in 16.16 format but aren't */
/* transformed by the affine transformation specified by */
/* @FT_Set_Transform. */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Advances
*
* @description:
* Retrieve the advance values of several glyph outlines in an @FT_Face.
*
* @input:
* face ::
* The source @FT_Face handle.
*
* start ::
* The first glyph index.
*
* count ::
* The number of advance values you want to retrieve.
*
* load_flags ::
* A set of bit flags similar to those used when calling
* @FT_Load_Glyph.
*
* @output:
* padvance ::
* The advance values. This array, to be provided by the caller, must
* contain at least `count` elements.
*
* If scaling is performed (based on the value of `load_flags`), the
* advance values are in 16.16 format. Otherwise, they are in font
* units.
*
* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances
* corresponding to a vertical layout. Otherwise, they are the
* horizontal advances in a horizontal layout.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
* the corresponding font backend doesn't have a quick way to retrieve
* the advances.
*
* Scaled advances are returned in 16.16 format but aren't transformed by
* the affine transformation specified by @FT_Set_Transform.
*/
FT_EXPORT( FT_Error )
FT_Get_Advances( FT_Face face,
FT_UInt start,

View File

@ -1,30 +1,30 @@
/***************************************************************************/
/* */
/* ftbbox.h */
/* */
/* FreeType exact bbox computation (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftbbox.h
*
* FreeType exact bbox computation (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* This component has a _single_ role: to compute exact outline bounding */
/* boxes. */
/* */
/* It is separated from the rest of the engine for various technical */
/* reasons. It may well be integrated in `ftoutln' later. */
/* */
/*************************************************************************/
/**************************************************************************
*
* This component has a _single_ role: to compute exact outline bounding
* boxes.
*
* It is separated from the rest of the engine for various technical
* reasons. It may well be integrated in 'ftoutln' later.
*
*/
#ifndef FTBBOX_H_
@ -44,43 +44,44 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* outline_processing */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* outline_processing
*
*/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Get_BBox */
/* */
/* <Description> */
/* Compute the exact bounding box of an outline. This is slower */
/* than computing the control box. However, it uses an advanced */
/* algorithm that returns _very_ quickly when the two boxes */
/* coincide. Otherwise, the outline Bezier arcs are traversed to */
/* extract their extrema. */
/* */
/* <Input> */
/* outline :: A pointer to the source outline. */
/* */
/* <Output> */
/* abbox :: The outline's exact bounding box. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* If the font is tricky and the glyph has been loaded with */
/* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
/* reasonable values for the BBox it is necessary to load the glyph */
/* at a large ppem value (so that the hinting instructions can */
/* properly shift and scale the subglyphs), then extracting the BBox, */
/* which can be eventually converted back to font units. */
/* */
/**************************************************************************
*
* @function:
* FT_Outline_Get_BBox
*
* @description:
* Compute the exact bounding box of an outline. This is slower than
* computing the control box. However, it uses an advanced algorithm
* that returns _very_ quickly when the two boxes coincide. Otherwise,
* the outline Bezier arcs are traversed to extract their extrema.
*
* @input:
* outline ::
* A pointer to the source outline.
*
* @output:
* abbox ::
* The outline's exact bounding box.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If the font is tricky and the glyph has been loaded with
* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get
* reasonable values for the BBox it is necessary to load the glyph at a
* large ppem value (so that the hinting instructions can properly shift
* and scale the subglyphs), then extracting the BBox, which can be
* eventually converted back to font units.
*/
FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftbdf.h */
/* */
/* FreeType API for accessing BDF-specific strings (specification). */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftbdf.h
*
* FreeType API for accessing BDF-specific strings (specification).
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTBDF_H_
@ -32,25 +32,25 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* bdf_fonts */
/* */
/* <Title> */
/* BDF and PCF Files */
/* */
/* <Abstract> */
/* BDF and PCF specific API. */
/* */
/* <Description> */
/* This section contains the declaration of functions specific to BDF */
/* and PCF fonts. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* bdf_fonts
*
* @title:
* BDF and PCF Files
*
* @abstract:
* BDF and PCF specific API.
*
* @description:
* This section contains the declaration of functions specific to BDF and
* PCF fonts.
*
*/
/**********************************************************************
/**************************************************************************
*
* @enum:
* BDF_PropertyType
@ -81,40 +81,40 @@ FT_BEGIN_HEADER
} BDF_PropertyType;
/**********************************************************************
/**************************************************************************
*
* @type:
* BDF_Property
*
* @description:
* A handle to a @BDF_PropertyRec structure to model a given
* BDF/PCF property.
* A handle to a @BDF_PropertyRec structure to model a given BDF/PCF
* property.
*/
typedef struct BDF_PropertyRec_* BDF_Property;
/**********************************************************************
*
* @struct:
* BDF_PropertyRec
*
* @description:
* This structure models a given BDF/PCF property.
*
* @fields:
* type ::
* The property type.
*
* u.atom ::
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
* NULL, indicating an empty string.
*
* u.integer ::
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
*
* u.cardinal ::
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
*/
/**************************************************************************
*
* @struct:
* BDF_PropertyRec
*
* @description:
* This structure models a given BDF/PCF property.
*
* @fields:
* type ::
* The property type.
*
* u.atom ::
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
* `NULL`, indicating an empty string.
*
* u.integer ::
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
*
* u.cardinal ::
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
*/
typedef struct BDF_PropertyRec_
{
BDF_PropertyType type;
@ -128,73 +128,76 @@ FT_BEGIN_HEADER
} BDF_PropertyRec;
/**********************************************************************
*
* @function:
* FT_Get_BDF_Charset_ID
*
* @description:
* Retrieve a BDF font character set identity, according to
* the BDF specification.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* acharset_encoding ::
* Charset encoding, as a C~string, owned by the face.
*
* acharset_registry ::
* Charset registry, as a C~string, owned by the face.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with BDF faces, returning an error otherwise.
*/
/**************************************************************************
*
* @function:
* FT_Get_BDF_Charset_ID
*
* @description:
* Retrieve a BDF font character set identity, according to the BDF
* specification.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* acharset_encoding ::
* Charset encoding, as a C~string, owned by the face.
*
* acharset_registry ::
* Charset registry, as a C~string, owned by the face.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with BDF faces, returning an error otherwise.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Charset_ID( FT_Face face,
const char* *acharset_encoding,
const char* *acharset_registry );
/**********************************************************************
*
* @function:
* FT_Get_BDF_Property
*
* @description:
* Retrieve a BDF property from a BDF or PCF font file.
*
* @input:
* face :: A handle to the input face.
*
* name :: The property name.
*
* @output:
* aproperty :: The property.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function works with BDF _and_ PCF fonts. It returns an error
* otherwise. It also returns an error if the property is not in the
* font.
*
* A `property' is a either key-value pair within the STARTPROPERTIES
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the
* `info->props' array within a `FontRec' structure of a PCF font.
*
* Integer properties are always stored as `signed' within PCF fonts;
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
* for BDF fonts only.
*
* In case of error, `aproperty->type' is always set to
* @BDF_PROPERTY_TYPE_NONE.
*/
/**************************************************************************
*
* @function:
* FT_Get_BDF_Property
*
* @description:
* Retrieve a BDF property from a BDF or PCF font file.
*
* @input:
* face ::
* A handle to the input face.
*
* name ::
* The property name.
*
* @output:
* aproperty ::
* The property.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function works with BDF _and_ PCF fonts. It returns an error
* otherwise. It also returns an error if the property is not in the
* font.
*
* A 'property' is a either key-value pair within the STARTPROPERTIES
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the
* `info->props` array within a `FontRec` structure of a PCF font.
*
* Integer properties are always stored as 'signed' within PCF fonts;
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
* for BDF fonts only.
*
* In case of error, `aproperty->type` is always set to
* @BDF_PROPERTY_TYPE_NONE.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Property( FT_Face face,
const char* prop_name,

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftbitmap.h */
/* */
/* FreeType utility functions for bitmaps (specification). */
/* */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftbitmap.h
*
* FreeType utility functions for bitmaps (specification).
*
* Copyright (C) 2004-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTBITMAP_H_
@ -22,6 +22,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_COLOR_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@ -33,39 +34,46 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* bitmap_handling */
/* */
/* <Title> */
/* Bitmap Handling */
/* */
/* <Abstract> */
/* Handling FT_Bitmap objects. */
/* */
/* <Description> */
/* This section contains functions for handling @FT_Bitmap objects. */
/* Note that none of the functions changes the bitmap's `flow' (as */
/* indicated by the sign of the `pitch' field in `FT_Bitmap'). */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* bitmap_handling
*
* @title:
* Bitmap Handling
*
* @abstract:
* Handling FT_Bitmap objects.
*
* @description:
* This section contains functions for handling @FT_Bitmap objects,
* automatically adjusting the target's bitmap buffer size as needed.
*
* Note that none of the functions changes the bitmap's 'flow' (as
* indicated by the sign of the `pitch` field in @FT_Bitmap).
*
* To set the flow, assign an appropriate positive or negative value to
* the `pitch` field of the target @FT_Bitmap object after calling
* @FT_Bitmap_Init but before calling any of the other functions
* described here.
*/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Init */
/* */
/* <Description> */
/* Initialize a pointer to an @FT_Bitmap structure. */
/* */
/* <InOut> */
/* abitmap :: A pointer to the bitmap structure. */
/* */
/* <Note> */
/* A deprecated name for the same function is `FT_Bitmap_New'. */
/* */
/**************************************************************************
*
* @function:
* FT_Bitmap_Init
*
* @description:
* Initialize a pointer to an @FT_Bitmap structure.
*
* @inout:
* abitmap ::
* A pointer to the bitmap structure.
*
* @note:
* A deprecated name for the same function is `FT_Bitmap_New`.
*/
FT_EXPORT( void )
FT_Bitmap_Init( FT_Bitmap *abitmap );
@ -75,66 +83,77 @@ FT_BEGIN_HEADER
FT_Bitmap_New( FT_Bitmap *abitmap );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Copy */
/* */
/* <Description> */
/* Copy a bitmap into another one. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: A handle to the source bitmap. */
/* */
/* <Output> */
/* target :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/**************************************************************************
*
* @function:
* FT_Bitmap_Copy
*
* @description:
* Copy a bitmap into another one.
*
* @input:
* library ::
* A handle to a library object.
*
* source ::
* A handle to the source bitmap.
*
* @output:
* target ::
* A handle to the target bitmap.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* `source->buffer` and `target->buffer` must neither be equal nor
* overlap.
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Embolden */
/* */
/* <Description> */
/* Embolden a bitmap. The new bitmap will be about `xStrength' */
/* pixels wider and `yStrength' pixels higher. The left and bottom */
/* borders are kept unchanged. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* xStrength :: How strong the glyph is emboldened horizontally. */
/* Expressed in 26.6 pixel format. */
/* */
/* yStrength :: How strong the glyph is emboldened vertically. */
/* Expressed in 26.6 pixel format. */
/* */
/* <InOut> */
/* bitmap :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The current implementation restricts `xStrength' to be less than */
/* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
/* */
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
/* */
/* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */
/* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */
/* */
/**************************************************************************
*
* @function:
* FT_Bitmap_Embolden
*
* @description:
* Embolden a bitmap. The new bitmap will be about `xStrength` pixels
* wider and `yStrength` pixels higher. The left and bottom borders are
* kept unchanged.
*
* @input:
* library ::
* A handle to a library object.
*
* xStrength ::
* How strong the glyph is emboldened horizontally. Expressed in 26.6
* pixel format.
*
* yStrength ::
* How strong the glyph is emboldened vertically. Expressed in 26.6
* pixel format.
*
* @inout:
* bitmap ::
* A handle to the target bitmap.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The current implementation restricts `xStrength` to be less than or
* equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.
*
* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, you
* should call @FT_GlyphSlot_Own_Bitmap on the slot first.
*
* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format are
* converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp).
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
@ -142,39 +161,46 @@ FT_BEGIN_HEADER
FT_Pos yStrength );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Convert */
/* */
/* <Description> */
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */
/* to a bitmap object with depth 8bpp, making the number of used */
/* bytes line (a.k.a. the `pitch') a multiple of `alignment'. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: The source bitmap. */
/* */
/* alignment :: The pitch of the bitmap is a multiple of this */
/* parameter. Common values are 1, 2, or 4. */
/* */
/* <Output> */
/* target :: The target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* It is possible to call @FT_Bitmap_Convert multiple times without */
/* calling @FT_Bitmap_Done (the memory is simply reallocated). */
/* */
/* Use @FT_Bitmap_Done to finally remove the bitmap object. */
/* */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
/**************************************************************************
*
* @function:
* FT_Bitmap_Convert
*
* @description:
* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to
* a bitmap object with depth 8bpp, making the number of used bytes per
* line (a.k.a. the 'pitch') a multiple of `alignment`.
*
* @input:
* library ::
* A handle to a library object.
*
* source ::
* The source bitmap.
*
* alignment ::
* The pitch of the bitmap is a multiple of this argument. Common
* values are 1, 2, or 4.
*
* @output:
* target ::
* The target bitmap.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* It is possible to call @FT_Bitmap_Convert multiple times without
* calling @FT_Bitmap_Done (the memory is simply reallocated).
*
* Use @FT_Bitmap_Done to finally remove the bitmap object.
*
* The `library` argument is taken to have access to FreeType's memory
* handling functions.
*
* `source->buffer` and `target->buffer` must neither be equal nor
* overlap.
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Convert( FT_Library library,
const FT_Bitmap *source,
@ -182,48 +208,112 @@ FT_BEGIN_HEADER
FT_Int alignment );
/*************************************************************************/
/* */
/* <Function> */
/* FT_GlyphSlot_Own_Bitmap */
/* */
/* <Description> */
/* Make sure that a glyph slot owns `slot->bitmap'. */
/* */
/* <Input> */
/* slot :: The glyph slot. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function is to be used in combination with */
/* @FT_Bitmap_Embolden. */
/* */
/**************************************************************************
*
* @function:
* FT_Bitmap_Blend
*
* @description:
* Blend a bitmap onto another bitmap, using a given color.
*
* @input:
* library ::
* A handle to a library object.
*
* source ::
* The source bitmap, which can have any @FT_Pixel_Mode format.
*
* source_offset ::
* The offset vector to the upper left corner of the source bitmap in
* 26.6 pixel format. It should represent an integer offset; the
* function will set the lowest six bits to zero to enforce that.
*
* color ::
* The color used to draw `source` onto `target`.
*
* @inout:
* target ::
* A handle to an `FT_Bitmap` object. It should be either initialized
* as empty with a call to @FT_Bitmap_Init, or it should be of type
* @FT_PIXEL_MODE_BGRA.
*
* atarget_offset ::
* The offset vector to the upper left corner of the target bitmap in
* 26.6 pixel format. It should represent an integer offset; the
* function will set the lowest six bits to zero to enforce that.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function doesn't perform clipping.
*
* The bitmap in `target` gets allocated or reallocated as needed; the
* vector `atarget_offset` is updated accordingly.
*
* In case of allocation or reallocation, the bitmap's pitch is set to
* `4 * width`. Both `source` and `target` must have the same bitmap
* flow (as indicated by the sign of the `pitch` field).
*
* `source->buffer` and `target->buffer` must neither be equal nor
* overlap.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Blend( FT_Library library,
const FT_Bitmap* source,
const FT_Vector source_offset,
FT_Bitmap* target,
FT_Vector *atarget_offset,
FT_Color color );
/**************************************************************************
*
* @function:
* FT_GlyphSlot_Own_Bitmap
*
* @description:
* Make sure that a glyph slot owns `slot->bitmap`.
*
* @input:
* slot ::
* The glyph slot.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function is to be used in combination with @FT_Bitmap_Embolden.
*/
FT_EXPORT( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Done */
/* */
/* <Description> */
/* Destroy a bitmap object initialized with @FT_Bitmap_Init. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* bitmap :: The bitmap object to be freed. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
/**************************************************************************
*
* @function:
* FT_Bitmap_Done
*
* @description:
* Destroy a bitmap object initialized with @FT_Bitmap_Init.
*
* @input:
* library ::
* A handle to a library object.
*
* bitmap ::
* The bitmap object to be freed.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The `library` argument is taken to have access to FreeType's memory
* handling functions.
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap );

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftbzip2.h */
/* */
/* Bzip2-compressed stream support. */
/* */
/* Copyright 2010-2018 by */
/* Joel Klinghed. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftbzip2.h
*
* Bzip2-compressed stream support.
*
* Copyright (C) 2010-2019 by
* Joel Klinghed.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTBZIP2_H_
@ -31,62 +31,62 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* bzip2 */
/* */
/* <Title> */
/* BZIP2 Streams */
/* */
/* <Abstract> */
/* Using bzip2-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of Bzip2-specific functions. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* bzip2
*
* @title:
* BZIP2 Streams
*
* @abstract:
* Using bzip2-compressed font files.
*
* @description:
* This section contains the declaration of Bzip2-specific functions.
*
*/
/************************************************************************
*
* @function:
* FT_Stream_OpenBzip2
*
* @description:
* Open a new stream to parse bzip2-compressed font files. This is
* mainly used to support the compressed `*.pcf.bz2' fonts that come
* with XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, bzip2 compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a bzip2 compressed stream
* from it and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with bzip2 support.
*/
/**************************************************************************
*
* @function:
* FT_Stream_OpenBzip2
*
* @description:
* Open a new stream to parse bzip2-compressed font files. This is
* mainly used to support the compressed `*.pcf.bz2` fonts that come with
* XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close` on the new stream will
* **not** call `FT_Stream_Close` on the source stream. None of the
* stream objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, bzip2 compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a bzip2 compressed
* stream from it and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with bzip2 support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenBzip2( FT_Stream stream,
FT_Stream source );

File diff suppressed because it is too large Load Diff

View File

@ -1,139 +1,145 @@
/***************************************************************************/
/* */
/* This file defines the structure of the FreeType reference. */
/* It is used by the python script that generates the HTML files. */
/* */
/***************************************************************************/
/****************************************************************************
*
* This file defines the structure of the FreeType reference.
* It is used by the python script that generates the HTML files.
*
*/
/***************************************************************************/
/* */
/* <Chapter> */
/* general_remarks */
/* */
/* <Title> */
/* General Remarks */
/* */
/* <Sections> */
/* header_inclusion */
/* user_allocation */
/* */
/***************************************************************************/
/**************************************************************************
*
* @chapter:
* general_remarks
*
* @title:
* General Remarks
*
* @sections:
* header_inclusion
* user_allocation
*
*/
/***************************************************************************/
/* */
/* <Chapter> */
/* core_api */
/* */
/* <Title> */
/* Core API */
/* */
/* <Sections> */
/* version */
/* basic_types */
/* base_interface */
/* glyph_variants */
/* glyph_management */
/* mac_specific */
/* sizes_management */
/* header_file_macros */
/* */
/***************************************************************************/
/**************************************************************************
*
* @chapter:
* core_api
*
* @title:
* Core API
*
* @sections:
* version
* basic_types
* base_interface
* glyph_variants
* color_management
* layer_management
* glyph_management
* mac_specific
* sizes_management
* header_file_macros
*
*/
/***************************************************************************/
/* */
/* <Chapter> */
/* format_specific */
/* */
/* <Title> */
/* Format-Specific API */
/* */
/* <Sections> */
/* multiple_masters */
/* truetype_tables */
/* type1_tables */
/* sfnt_names */
/* bdf_fonts */
/* cid_fonts */
/* pfr_fonts */
/* winfnt_fonts */
/* font_formats */
/* gasp_table */
/* */
/***************************************************************************/
/**************************************************************************
*
* @chapter:
* format_specific
*
* @title:
* Format-Specific API
*
* @sections:
* multiple_masters
* truetype_tables
* type1_tables
* sfnt_names
* bdf_fonts
* cid_fonts
* pfr_fonts
* winfnt_fonts
* font_formats
* gasp_table
*
*/
/***************************************************************************/
/* */
/* <Chapter> */
/* module_specific */
/* */
/* <Title> */
/* Controlling FreeType Modules */
/* */
/* <Sections> */
/* auto_hinter */
/* cff_driver */
/* t1_cid_driver */
/* tt_driver */
/* pcf_driver */
/* properties */
/* parameter_tags */
/* */
/***************************************************************************/
/**************************************************************************
*
* @chapter:
* module_specific
*
* @title:
* Controlling FreeType Modules
*
* @sections:
* auto_hinter
* cff_driver
* t1_cid_driver
* tt_driver
* pcf_driver
* properties
* parameter_tags
* lcd_rendering
*
*/
/***************************************************************************/
/* */
/* <Chapter> */
/* cache_subsystem */
/* */
/* <Title> */
/* Cache Sub-System */
/* */
/* <Sections> */
/* cache_subsystem */
/* */
/***************************************************************************/
/**************************************************************************
*
* @chapter:
* cache_subsystem
*
* @title:
* Cache Sub-System
*
* @sections:
* cache_subsystem
*
*/
/***************************************************************************/
/* */
/* <Chapter> */
/* support_api */
/* */
/* <Title> */
/* Support API */
/* */
/* <Sections> */
/* computations */
/* list_processing */
/* outline_processing */
/* quick_advance */
/* bitmap_handling */
/* raster */
/* glyph_stroker */
/* system_interface */
/* module_management */
/* gzip */
/* lzw */
/* bzip2 */
/* lcd_filtering */
/* */
/***************************************************************************/
/**************************************************************************
*
* @chapter:
* support_api
*
* @title:
* Support API
*
* @sections:
* computations
* list_processing
* outline_processing
* quick_advance
* bitmap_handling
* raster
* glyph_stroker
* system_interface
* module_management
* gzip
* lzw
* bzip2
*
*/
/***************************************************************************/
/* */
/* <Chapter> */
/* error_codes */
/* */
/* <Title> */
/* Error Codes */
/* */
/* <Sections> */
/* error_enumerations */
/* error_code_values */
/* */
/***************************************************************************/
/**************************************************************************
*
* @chapter:
* error_codes
*
* @title:
* Error Codes
*
* @sections:
* error_enumerations
* error_code_values
*
*/
/* END */

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftcid.h */
/* */
/* FreeType API for accessing CID font information (specification). */
/* */
/* Copyright 2007-2018 by */
/* Dereg Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftcid.h
*
* FreeType API for accessing CID font information (specification).
*
* Copyright (C) 2007-2019 by
* Dereg Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTCID_H_
@ -32,25 +32,25 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* cid_fonts */
/* */
/* <Title> */
/* CID Fonts */
/* */
/* <Abstract> */
/* CID-keyed font specific API. */
/* */
/* <Description> */
/* This section contains the declaration of CID-keyed font specific */
/* functions. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* cid_fonts
*
* @title:
* CID Fonts
*
* @abstract:
* CID-keyed font-specific API.
*
* @description:
* This section contains the declaration of CID-keyed font-specific
* functions.
*
*/
/**********************************************************************
/**************************************************************************
*
* @function:
* FT_Get_CID_Registry_Ordering_Supplement
@ -61,17 +61,17 @@ FT_BEGIN_HEADER
*
* @input:
* face ::
* A handle to the input face.
* A handle to the input face.
*
* @output:
* registry ::
* The registry, as a C~string, owned by the face.
* The registry, as a C~string, owned by the face.
*
* ordering ::
* The ordering, as a C~string, owned by the face.
* The ordering, as a C~string, owned by the face.
*
* supplement ::
* The supplement.
* The supplement.
*
* @return:
* FreeType error code. 0~means success.
@ -90,30 +90,30 @@ FT_BEGIN_HEADER
FT_Int *supplement );
/**********************************************************************
/**************************************************************************
*
* @function:
* FT_Get_CID_Is_Internally_CID_Keyed
*
* @description:
* Retrieve the type of the input face, CID keyed or not. In
* contrast to the @FT_IS_CID_KEYED macro this function returns
* successfully also for CID-keyed fonts in an SFNT wrapper.
* Retrieve the type of the input face, CID keyed or not. In contrast
* to the @FT_IS_CID_KEYED macro this function returns successfully also
* for CID-keyed fonts in an SFNT wrapper.
*
* @input:
* face ::
* A handle to the input face.
* A handle to the input face.
*
* @output:
* is_cid ::
* The type of the face as an @FT_Bool.
* The type of the face as an @FT_Bool.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts,
* returning an error otherwise.
* This function only works with CID faces and OpenType fonts, returning
* an error otherwise.
*
* @since:
* 2.3.9
@ -123,7 +123,7 @@ FT_BEGIN_HEADER
FT_Bool *is_cid );
/**********************************************************************
/**************************************************************************
*
* @function:
* FT_Get_CID_From_Glyph_Index
@ -133,21 +133,21 @@ FT_BEGIN_HEADER
*
* @input:
* face ::
* A handle to the input face.
* A handle to the input face.
*
* glyph_index ::
* The input glyph index.
* The input glyph index.
*
* @output:
* cid ::
* The CID as an @FT_UInt.
* The CID as an @FT_UInt.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts,
* returning an error otherwise.
* This function only works with CID faces and OpenType fonts, returning
* an error otherwise.
*
* @since:
* 2.3.9

View File

@ -0,0 +1,311 @@
/****************************************************************************
*
* ftcolor.h
*
* FreeType's glyph color management (specification).
*
* Copyright (C) 2018-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTCOLOR_H_
#define FTCOLOR_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* color_management
*
* @title:
* Glyph Color Management
*
* @abstract:
* Retrieving and manipulating OpenType's 'CPAL' table data.
*
* @description:
* The functions described here allow access and manipulation of color
* palette entries in OpenType's 'CPAL' tables.
*/
/**************************************************************************
*
* @struct:
* FT_Color
*
* @description:
* This structure models a BGRA color value of a 'CPAL' palette entry.
*
* The used color space is sRGB; the colors are not pre-multiplied, and
* alpha values must be explicitly set.
*
* @fields:
* blue ::
* Blue value.
*
* green ::
* Green value.
*
* red ::
* Red value.
*
* alpha ::
* Alpha value, giving the red, green, and blue color's opacity.
*
* @since:
* 2.10
*/
typedef struct FT_Color_
{
FT_Byte blue;
FT_Byte green;
FT_Byte red;
FT_Byte alpha;
} FT_Color;
/**************************************************************************
*
* @enum:
* FT_PALETTE_XXX
*
* @description:
* A list of bit field constants used in the `palette_flags` array of the
* @FT_Palette_Data structure to indicate for which background a palette
* with a given index is usable.
*
* @values:
* FT_PALETTE_FOR_LIGHT_BACKGROUND ::
* The palette is appropriate to use when displaying the font on a
* light background such as white.
*
* FT_PALETTE_FOR_DARK_BACKGROUND ::
* The palette is appropriate to use when displaying the font on a dark
* background such as black.
*
* @since:
* 2.10
*/
#define FT_PALETTE_FOR_LIGHT_BACKGROUND 0x01
#define FT_PALETTE_FOR_DARK_BACKGROUND 0x02
/**************************************************************************
*
* @struct:
* FT_Palette_Data
*
* @description:
* This structure holds the data of the 'CPAL' table.
*
* @fields:
* num_palettes ::
* The number of palettes.
*
* palette_name_ids ::
* A read-only array of palette name IDs with `num_palettes` elements,
* corresponding to entries like 'dark' or 'light' in the font's 'name'
* table.
*
* An empty name ID in the 'CPAL' table gets represented as value
* 0xFFFF.
*
* `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
*
* palette_flags ::
* A read-only array of palette flags with `num_palettes` elements.
* Possible values are an ORed combination of
* @FT_PALETTE_FOR_LIGHT_BACKGROUND and
* @FT_PALETTE_FOR_DARK_BACKGROUND.
*
* `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
*
* num_palette_entries ::
* The number of entries in a single palette. All palettes have the
* same size.
*
* palette_entry_name_ids ::
* A read-only array of palette entry name IDs with
* `num_palette_entries`. In each palette, entries with the same index
* have the same function. For example, index~0 might correspond to
* string 'outline' in the font's 'name' table to indicate that this
* palette entry is used for outlines, index~1 might correspond to
* 'fill' to indicate the filling color palette entry, etc.
*
* An empty entry name ID in the 'CPAL' table gets represented as value
* 0xFFFF.
*
* `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
*
* @note:
* Use function @FT_Get_Sfnt_Name to map name IDs and entry name IDs to
* name strings.
*
* @since:
* 2.10
*/
typedef struct FT_Palette_Data_ {
FT_UShort num_palettes;
const FT_UShort* palette_name_ids;
const FT_UShort* palette_flags;
FT_UShort num_palette_entries;
const FT_UShort* palette_entry_name_ids;
} FT_Palette_Data;
/**************************************************************************
*
* @function:
* FT_Palette_Data_Get
*
* @description:
* Retrieve the face's color palette data.
*
* @input:
* face ::
* The source face handle.
*
* @output:
* apalette ::
* A pointer to an @FT_Palette_Data structure.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* All arrays in the returned @FT_Palette_Data structure are read-only.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Palette_Data_Get( FT_Face face,
FT_Palette_Data *apalette );
/**************************************************************************
*
* @function:
* FT_Palette_Select
*
* @description:
* This function has two purposes.
*
* (1) It activates a palette for rendering color glyphs, and
*
* (2) it retrieves all (unmodified) color entries of this palette. This
* function returns a read-write array, which means that a calling
* application can modify the palette entries on demand.
*
* A corollary of (2) is that calling the function, then modifying some
* values, then calling the function again with the same arguments resets
* all color entries to the original 'CPAL' values; all user modifications
* are lost.
*
* @input:
* face ::
* The source face handle.
*
* palette_index ::
* The palette index.
*
* @output:
* apalette ::
* An array of color entries for a palette with index `palette_index`,
* having `num_palette_entries` elements (as found in the
* `FT_Palette_Data` structure). If `apalette` is set to `NULL`, no
* array gets returned (and no color entries can be modified).
*
* In case the font doesn't support color palettes, `NULL` is returned.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The array pointed to by `apalette_entries` is owned and managed by
* FreeType.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Palette_Select( FT_Face face,
FT_UShort palette_index,
FT_Color* *apalette );
/**************************************************************************
*
* @function:
* FT_Palette_Set_Foreground_Color
*
* @description:
* 'COLR' uses palette index 0xFFFF to indicate a 'text foreground
* color'. This function sets this value.
*
* @input:
* face ::
* The source face handle.
*
* foreground_color ::
* An `FT_Color` structure to define the text foreground color.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If this function isn't called, the text foreground color is set to
* white opaque (BGRA value 0xFFFFFFFF) if
* @FT_PALETTE_FOR_DARK_BACKGROUND is present for the current palette,
* and black opaque (BGRA value 0x000000FF) otherwise, including the case
* that no palette types are available in the 'CPAL' table.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Palette_Set_Foreground_Color( FT_Face face,
FT_Color foreground_color );
/* */
FT_END_HEADER
#endif /* FTCOLOR_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@ -1,58 +1,57 @@
/***************************************************************************/
/* */
/* fterrdef.h */
/* */
/* FreeType error codes (specification). */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* fterrdef.h
*
* FreeType error codes (specification).
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* <Section> */
/* error_code_values */
/* */
/* <Title> */
/* Error Code Values */
/* */
/* <Abstract> */
/* All possible error codes returned by FreeType functions. */
/* */
/* <Description> */
/* The list below is taken verbatim from the file `fterrdef.h' */
/* (loaded automatically by including `FT_FREETYPE_H'). The first */
/* argument of the `FT_ERROR_DEF_' macro is the error label; by */
/* default, the prefix `FT_Err_' gets added so that you get error */
/* names like `FT_Err_Cannot_Open_Resource'. The second argument is */
/* the error code, and the last argument an error string, which is not */
/* used by FreeType. */
/* */
/* Within your application you should *only* use error names and */
/* *never* its numeric values! The latter might (and actually do) */
/* change in forthcoming FreeType versions. */
/* */
/* Macro `FT_NOERRORDEF_' defines `FT_Err_Ok', which is always zero. */
/* See the `Error Enumerations' subsection how to automatically */
/* generate a list of error strings. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* error_code_values
*
* @title:
* Error Code Values
*
* @abstract:
* All possible error codes returned by FreeType functions.
*
* @description:
* The list below is taken verbatim from the file `fterrdef.h` (loaded
* automatically by including `FT_FREETYPE_H`). The first argument of the
* `FT_ERROR_DEF_` macro is the error label; by default, the prefix
* `FT_Err_` gets added so that you get error names like
* `FT_Err_Cannot_Open_Resource`. The second argument is the error code,
* and the last argument an error string, which is not used by FreeType.
*
* Within your application you should **only** use error names and
* **never** its numeric values! The latter might (and actually do)
* change in forthcoming FreeType versions.
*
* Macro `FT_NOERRORDEF_` defines `FT_Err_Ok`, which is always zero. See
* the 'Error Enumerations' subsection how to automatically generate a
* list of error strings.
*
*/
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Err_XXX */
/* */
/*************************************************************************/
/**************************************************************************
*
* @enum:
* FT_Err_XXX
*
*/
/* generic errors */

View File

@ -1,110 +1,120 @@
/***************************************************************************/
/* */
/* fterrors.h */
/* */
/* FreeType error code handling (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* fterrors.h
*
* FreeType error code handling (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* <Section> */
/* error_enumerations */
/* */
/* <Title> */
/* Error Enumerations */
/* */
/* <Abstract> */
/* How to handle errors and error strings. */
/* */
/* <Description> */
/* The header file `fterrors.h' (which is automatically included by */
/* `freetype.h' defines the handling of FreeType's enumeration */
/* constants. It can also be used to generate error message strings */
/* with a small macro trick explained below. */
/* */
/* *Error* *Formats* */
/* */
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
/* defined in `ftoption.h' in order to make the higher byte indicate */
/* the module where the error has happened (this is not compatible */
/* with standard builds of FreeType~2, however). See the file */
/* `ftmoderr.h' for more details. */
/* */
/* *Error* *Message* *Strings* */
/* */
/* Error definitions are set up with special macros that allow client */
/* applications to build a table of error message strings. The */
/* strings are not included in a normal build of FreeType~2 to save */
/* space (most client applications do not use them). */
/* */
/* To do so, you have to define the following macros before including */
/* this file. */
/* */
/* { */
/* FT_ERROR_START_LIST */
/* } */
/* */
/* This macro is called before anything else to define the start of */
/* the error list. It is followed by several FT_ERROR_DEF calls. */
/* */
/* { */
/* FT_ERROR_DEF( e, v, s ) */
/* } */
/* */
/* This macro is called to define one single error. `e' is the error */
/* code identifier (e.g., `Invalid_Argument'), `v' is the error's */
/* numerical value, and `s' is the corresponding error string. */
/* */
/* { */
/* FT_ERROR_END_LIST */
/* } */
/* */
/* This macro ends the list. */
/* */
/* Additionally, you have to undefine `FTERRORS_H_' before #including */
/* this file. */
/* */
/* Here is a simple example. */
/* */
/* { */
/* #undef FTERRORS_H_ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, NULL } }; */
/* */
/* const struct */
/* { */
/* int err_code; */
/* const char* err_msg; */
/* } ft_errors[] = */
/* */
/* #include FT_ERRORS_H */
/* } */
/* */
/* Note that `FT_Err_Ok' is _not_ defined with `FT_ERRORDEF' but with */
/* `FT_NOERRORDEF'; it is always zero. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* error_enumerations
*
* @title:
* Error Enumerations
*
* @abstract:
* How to handle errors and error strings.
*
* @description:
* The header file `fterrors.h` (which is automatically included by
* `freetype.h` defines the handling of FreeType's enumeration
* constants. It can also be used to generate error message strings
* with a small macro trick explained below.
*
* **Error Formats**
*
* The configuration macro `FT_CONFIG_OPTION_USE_MODULE_ERRORS` can be
* defined in `ftoption.h` in order to make the higher byte indicate the
* module where the error has happened (this is not compatible with
* standard builds of FreeType~2, however). See the file `ftmoderr.h`
* for more details.
*
* **Error Message Strings**
*
* Error definitions are set up with special macros that allow client
* applications to build a table of error message strings. The strings
* are not included in a normal build of FreeType~2 to save space (most
* client applications do not use them).
*
* To do so, you have to define the following macros before including
* this file.
*
* ```
* FT_ERROR_START_LIST
* ```
*
* This macro is called before anything else to define the start of the
* error list. It is followed by several `FT_ERROR_DEF` calls.
*
* ```
* FT_ERROR_DEF( e, v, s )
* ```
*
* This macro is called to define one single error. 'e' is the error
* code identifier (e.g., `Invalid_Argument`), 'v' is the error's
* numerical value, and 's' is the corresponding error string.
*
* ```
* FT_ERROR_END_LIST
* ```
*
* This macro ends the list.
*
* Additionally, you have to undefine `FTERRORS_H_` before #including
* this file.
*
* Here is a simple example.
*
* ```
* #undef FTERRORS_H_
* #define FT_ERRORDEF( e, v, s ) { e, s },
* #define FT_ERROR_START_LIST {
* #define FT_ERROR_END_LIST { 0, NULL } };
*
* const struct
* {
* int err_code;
* const char* err_msg;
* } ft_errors[] =
*
* #include FT_ERRORS_H
* ```
*
* An alternative to using an array is a switch statement.
*
* ```
* #undef FTERRORS_H_
* #define FT_ERROR_START_LIST switch ( error_code ) {
* #define FT_ERRORDEF( e, v, s ) case v: return s;
* #define FT_ERROR_END_LIST }
* ```
*
* If you use `FT_CONFIG_OPTION_USE_MODULE_ERRORS`, `error_code` should
* be replaced with `FT_ERROR_BASE(error_code)` in the last example.
*/
/* */
/* In previous FreeType versions we used `__FTERRORS_H__'. However, */
/* In previous FreeType versions we used `__FTERRORS_H__`. However, */
/* using two successive underscores in a non-system symbol name */
/* violates the C (and C++) standard, so it was changed to the */
/* current form. In spite of this, we have to make */
/* */
/* ``` */
/* #undefine __FTERRORS_H__ */
/* ``` */
/* */
/* work for backward compatibility. */
/* */
@ -130,7 +140,7 @@
/* FT_ERR_PREFIX is used as a prefix for error identifiers. */
/* By default, we use `FT_Err_'. */
/* By default, we use `FT_Err_`. */
/* */
#ifndef FT_ERR_PREFIX
#define FT_ERR_PREFIX FT_Err_
@ -158,6 +168,8 @@
/* */
#ifndef FT_ERRORDEF
#define FT_INCLUDE_ERR_PROTOS
#define FT_ERRORDEF( e, v, s ) e = v,
#define FT_ERROR_START_LIST enum {
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
@ -220,6 +232,57 @@
#undef FT_ERR_PREFIX
#endif
/* FT_INCLUDE_ERR_PROTOS: Control if function prototypes should be */
/* included with `#include FT_ERRORS_H'. This is */
/* only true where `FT_ERRORDEF` is undefined. */
/* FT_ERR_PROTOS_DEFINED: Actual multiple-inclusion protection of */
/* `fterrors.h`. */
#ifdef FT_INCLUDE_ERR_PROTOS
#undef FT_INCLUDE_ERR_PROTOS
#ifndef FT_ERR_PROTOS_DEFINED
#define FT_ERR_PROTOS_DEFINED
FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
* FT_Error_String
*
* @description:
* Retrieve the description of a valid FreeType error code.
*
* @input:
* error_code ::
* A valid FreeType error code.
*
* @return:
* A C~string or `NULL`, if any error occurred.
*
* @note:
* FreeType has to be compiled with `FT_CONFIG_OPTION_ERROR_STRINGS` or
* `FT_DEBUG_LEVEL_ERROR` to get meaningful descriptions.
* 'error_string' will be `NULL` otherwise.
*
* Module identification will be ignored:
*
* ```c
* strcmp( FT_Error_String( FT_Err_Unknown_File_Format ),
* FT_Error_String( BDF_Err_Unknown_File_Format ) ) == 0;
* ```
*/
FT_EXPORT( const char* )
FT_Error_String( FT_Error error_code );
FT_END_HEADER
#endif /* FT_ERR_PROTOS_DEFINED */
#endif /* FT_INCLUDE_ERR_PROTOS */
#endif /* !(FTERRORS_H_ && __FTERRORS_H__) */

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftfntfmt.h */
/* */
/* Support functions for font formats. */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftfntfmt.h
*
* Support functions for font formats.
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTFNTFMT_H_
@ -32,49 +32,48 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* font_formats */
/* */
/* <Title> */
/* Font Formats */
/* */
/* <Abstract> */
/* Getting the font format. */
/* */
/* <Description> */
/* The single function in this section can be used to get the font */
/* format. Note that this information is not needed normally; */
/* however, there are special cases (like in PDF devices) where it is */
/* important to differentiate, in spite of FreeType's uniform API. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* font_formats
*
* @title:
* Font Formats
*
* @abstract:
* Getting the font format.
*
* @description:
* The single function in this section can be used to get the font format.
* Note that this information is not needed normally; however, there are
* special cases (like in PDF devices) where it is important to
* differentiate, in spite of FreeType's uniform API.
*
*/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Font_Format */
/* */
/* <Description> */
/* Return a string describing the format of a given face. Possible */
/* values are `TrueType', `Type~1', `BDF', `PCF', `Type~42', */
/* `CID~Type~1', `CFF', `PFR', and `Windows~FNT'. */
/* */
/* The return value is suitable to be used as an X11 FONT_PROPERTY. */
/* */
/* <Input> */
/* face :: */
/* Input face handle. */
/* */
/* <Return> */
/* Font format string. NULL in case of error. */
/* */
/* <Note> */
/* A deprecated name for the same function is */
/* `FT_Get_X11_Font_Format'. */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Font_Format
*
* @description:
* Return a string describing the format of a given face. Possible values
* are 'TrueType', 'Type~1', 'BDF', 'PCF', 'Type~42', 'CID~Type~1', 'CFF',
* 'PFR', and 'Windows~FNT'.
*
* The return value is suitable to be used as an X11 FONT_PROPERTY.
*
* @input:
* face ::
* Input face handle.
*
* @return:
* Font format string. `NULL` in case of error.
*
* @note:
* A deprecated name for the same function is `FT_Get_X11_Font_Format`.
*/
FT_EXPORT( const char* )
FT_Get_Font_Format( FT_Face face );

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftgasp.h */
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
/* Copyright 2007-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftgasp.h
*
* Access of TrueType's 'gasp' table (specification).
*
* Copyright (C) 2007-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTGASP_H_
@ -32,7 +32,7 @@
FT_BEGIN_HEADER
/***************************************************************************
/**************************************************************************
*
* @section:
* gasp_table
@ -41,16 +41,16 @@ FT_BEGIN_HEADER
* Gasp Table
*
* @abstract:
* Retrieving TrueType `gasp' table entries.
* Retrieving TrueType 'gasp' table entries.
*
* @description:
* The function @FT_Get_Gasp can be used to query a TrueType or OpenType
* font for specific entries in its `gasp' table, if any. This is
* mainly useful when implementing native TrueType hinting with the
* bytecode interpreter to duplicate the Windows text rendering results.
* font for specific entries in its 'gasp' table, if any. This is mainly
* useful when implementing native TrueType hinting with the bytecode
* interpreter to duplicate the Windows text rendering results.
*/
/*************************************************************************
/**************************************************************************
*
* @enum:
* FT_GASP_XXX
@ -66,7 +66,7 @@ FT_BEGIN_HEADER
*
* FT_GASP_DO_GRIDFIT ::
* Grid-fitting and hinting should be performed at the specified ppem.
* This *really* means TrueType bytecode interpretation. If this bit
* This **really** means TrueType bytecode interpretation. If this bit
* is not set, no hinting gets applied.
*
* FT_GASP_DO_GRAY ::
@ -80,13 +80,13 @@ FT_BEGIN_HEADER
* Grid-fitting must be used with ClearType's symmetric smoothing.
*
* @note:
* The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
* The bit-flags `FT_GASP_DO_GRIDFIT` and `FT_GASP_DO_GRAY` are to be
* used for standard font rasterization only. Independently of that,
* `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
* be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
* `FT_GASP_DO_GRAY' are consequently ignored).
* `FT_GASP_SYMMETRIC_SMOOTHING` and `FT_GASP_SYMMETRIC_GRIDFIT` are to
* be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT` and
* `FT_GASP_DO_GRAY` are consequently ignored).
*
* `ClearType' is Microsoft's implementation of LCD rendering, partly
* 'ClearType' is Microsoft's implementation of LCD rendering, partly
* protected by patents.
*
* @since:
@ -99,29 +99,31 @@ FT_BEGIN_HEADER
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
/*************************************************************************
/**************************************************************************
*
* @func:
* @function:
* FT_Get_Gasp
*
* @description:
* For a TrueType or OpenType font file, return the rasterizer behaviour
* flags from the font's `gasp' table corresponding to a given
* character pixel size.
* flags from the font's 'gasp' table corresponding to a given character
* pixel size.
*
* @input:
* face :: The source face handle.
* face ::
* The source face handle.
*
* ppem :: The vertical character pixel size.
* ppem ::
* The vertical character pixel size.
*
* @return:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
* `gasp' table in the face.
* 'gasp' table in the face.
*
* @note:
* If you want to use the MM functionality of OpenType variation fonts
* (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this
* function *after* setting an instance since the return values can
* function **after** setting an instance since the return values can
* change.
*
* @since:

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,28 @@
/***************************************************************************/
/* */
/* ftgxval.h */
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004-2018 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftgxval.h
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
* Copyright (C) 2004-2019 by
* Masatake YAMATO, Redhat K.K,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
/****************************************************************************
*
* gxvalid is derived from both gxlayout module and otvalid module.
* Development of gxlayout is supported by the Information-technology
* Promotion Agency(IPA), Japan.
*
*/
#ifndef FTGXVAL_H_
@ -41,43 +41,43 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* gx_validation */
/* */
/* <Title> */
/* TrueTypeGX/AAT Validation */
/* */
/* <Abstract> */
/* An API to validate TrueTypeGX/AAT tables. */
/* */
/* <Description> */
/* This section contains the declaration of functions to validate */
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
/* trak, prop, lcar). */
/* */
/* <Order> */
/* FT_TrueTypeGX_Validate */
/* FT_TrueTypeGX_Free */
/* */
/* FT_ClassicKern_Validate */
/* FT_ClassicKern_Free */
/* */
/* FT_VALIDATE_GX_LENGTH */
/* FT_VALIDATE_GXXXX */
/* FT_VALIDATE_CKERNXXX */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* gx_validation
*
* @title:
* TrueTypeGX/AAT Validation
*
* @abstract:
* An API to validate TrueTypeGX/AAT tables.
*
* @description:
* This section contains the declaration of functions to validate some
* TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak,
* prop, lcar).
*
* @order:
* FT_TrueTypeGX_Validate
* FT_TrueTypeGX_Free
*
* FT_ClassicKern_Validate
* FT_ClassicKern_Free
*
* FT_VALIDATE_GX_LENGTH
* FT_VALIDATE_GXXXX
* FT_VALIDATE_CKERNXXX
*
*/
/*************************************************************************/
/* */
/* */
/* Warning: Use FT_VALIDATE_XXX to validate a table. */
/* Following definitions are for gxvalid developers. */
/* */
/* */
/*************************************************************************/
/**************************************************************************
*
*
* Warning: Use `FT_VALIDATE_XXX` to validate a table.
* Following definitions are for gxvalid developers.
*
*
*/
#define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1
@ -92,14 +92,14 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_VALIDATE_GX_LENGTH
*
* @description:
* The number of tables checked in this module. Use it as a parameter
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
* for the `table-length` argument of function @FT_TrueTypeGX_Validate.
*/
#define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 )
@ -112,51 +112,51 @@ FT_BEGIN_HEADER
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/**********************************************************************
*
* @enum:
* FT_VALIDATE_GXXXX
*
* @description:
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
* indicate which TrueTypeGX/AAT Type tables should be validated.
*
* @values:
* FT_VALIDATE_feat ::
* Validate `feat' table.
*
* FT_VALIDATE_mort ::
* Validate `mort' table.
*
* FT_VALIDATE_morx ::
* Validate `morx' table.
*
* FT_VALIDATE_bsln ::
* Validate `bsln' table.
*
* FT_VALIDATE_just ::
* Validate `just' table.
*
* FT_VALIDATE_kern ::
* Validate `kern' table.
*
* FT_VALIDATE_opbd ::
* Validate `opbd' table.
*
* FT_VALIDATE_trak ::
* Validate `trak' table.
*
* FT_VALIDATE_prop ::
* Validate `prop' table.
*
* FT_VALIDATE_lcar ::
* Validate `lcar' table.
*
* FT_VALIDATE_GX ::
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
* opbd, trak, prop and lcar).
*
*/
/**************************************************************************
*
* @enum:
* FT_VALIDATE_GXXXX
*
* @description:
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
* indicate which TrueTypeGX/AAT Type tables should be validated.
*
* @values:
* FT_VALIDATE_feat ::
* Validate 'feat' table.
*
* FT_VALIDATE_mort ::
* Validate 'mort' table.
*
* FT_VALIDATE_morx ::
* Validate 'morx' table.
*
* FT_VALIDATE_bsln ::
* Validate 'bsln' table.
*
* FT_VALIDATE_just ::
* Validate 'just' table.
*
* FT_VALIDATE_kern ::
* Validate 'kern' table.
*
* FT_VALIDATE_opbd ::
* Validate 'opbd' table.
*
* FT_VALIDATE_trak ::
* Validate 'trak' table.
*
* FT_VALIDATE_prop ::
* Validate 'prop' table.
*
* FT_VALIDATE_lcar ::
* Validate 'lcar' table.
*
* FT_VALIDATE_GX ::
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
* opbd, trak, prop and lcar).
*
*/
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
@ -181,47 +181,47 @@ FT_BEGIN_HEADER
FT_VALIDATE_lcar )
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Validate
*
* @description:
* Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_GXXXX for possible values.
*
* table_length ::
* The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
* should be passed.
*
* @output:
* tables ::
* The array where all validated sfnt tables are stored.
* The array itself must be allocated by a client.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with TrueTypeGX fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the buffers pointed to by
* each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
* indicates that the table either doesn't exist in the font, the
* application hasn't asked for validation, or the validator doesn't have
* the ability to validate the sfnt table.
*/
/**************************************************************************
*
* @function:
* FT_TrueTypeGX_Validate
*
* @description:
* Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_GXXXX for possible values.
*
* table_length ::
* The size of the `tables` array. Normally, @FT_VALIDATE_GX_LENGTH
* should be passed.
*
* @output:
* tables ::
* The array where all validated sfnt tables are stored. The array
* itself must be allocated by a client.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with TrueTypeGX fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the buffers pointed to by
* each `tables` element, by calling @FT_TrueTypeGX_Free. A `NULL` value
* indicates that the table either doesn't exist in the font, the
* application hasn't asked for validation, or the validator doesn't have
* the ability to validate the sfnt table.
*/
FT_EXPORT( FT_Error )
FT_TrueTypeGX_Validate( FT_Face face,
FT_UInt validation_flags,
@ -229,119 +229,117 @@ FT_BEGIN_HEADER
FT_UInt table_length );
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Free
*
* @description:
* Free the buffer allocated by TrueTypeGX validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer allocated by
* @FT_TrueTypeGX_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_TrueTypeGX_Validate only.
*/
/**************************************************************************
*
* @function:
* FT_TrueTypeGX_Free
*
* @description:
* Free the buffer allocated by TrueTypeGX validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer allocated by @FT_TrueTypeGX_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_TrueTypeGX_Validate only.
*/
FT_EXPORT( void )
FT_TrueTypeGX_Free( FT_Face face,
FT_Bytes table );
/**********************************************************************
*
* @enum:
* FT_VALIDATE_CKERNXXX
*
* @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate
* to indicate the classic kern dialect or dialects. If the selected
* type doesn't fit, @FT_ClassicKern_Validate regards the table as
* invalid.
*
* @values:
* FT_VALIDATE_MS ::
* Handle the `kern' table as a classic Microsoft kern table.
*
* FT_VALIDATE_APPLE ::
* Handle the `kern' table as a classic Apple kern table.
*
* FT_VALIDATE_CKERN ::
* Handle the `kern' as either classic Apple or Microsoft kern table.
*/
/**************************************************************************
*
* @enum:
* FT_VALIDATE_CKERNXXX
*
* @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate to
* indicate the classic kern dialect or dialects. If the selected type
* doesn't fit, @FT_ClassicKern_Validate regards the table as invalid.
*
* @values:
* FT_VALIDATE_MS ::
* Handle the 'kern' table as a classic Microsoft kern table.
*
* FT_VALIDATE_APPLE ::
* Handle the 'kern' table as a classic Apple kern table.
*
* FT_VALIDATE_CKERN ::
* Handle the 'kern' as either classic Apple or Microsoft kern table.
*/
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
/**********************************************************************
*
* @function:
* FT_ClassicKern_Validate
*
* @description:
* Validate classic (16-bit format) kern table to assure that the offsets
* and indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
* The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
* the new 32-bit format and the classic 16-bit format, while
* FT_ClassicKern_Validate only supports the classic 16-bit format.
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values.
*
* @output:
* ckern_table ::
* A pointer to the kern table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* After use, the application should deallocate the buffers pointed to by
* `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
* indicates that the table doesn't exist in the font.
*/
/**************************************************************************
*
* @function:
* FT_ClassicKern_Validate
*
* @description:
* Validate classic (16-bit format) kern table to assure that the
* offsets and indices are valid. The idea is that a higher-level
* library that actually does the text layout can access those tables
* without error checking (which can be quite time consuming).
*
* The 'kern' table validator in @FT_TrueTypeGX_Validate deals with both
* the new 32-bit format and the classic 16-bit format, while
* FT_ClassicKern_Validate only supports the classic 16-bit format.
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values.
*
* @output:
* ckern_table ::
* A pointer to the kern table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* After use, the application should deallocate the buffers pointed to by
* `ckern_table`, by calling @FT_ClassicKern_Free. A `NULL` value
* indicates that the table doesn't exist in the font.
*/
FT_EXPORT( FT_Error )
FT_ClassicKern_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes *ckern_table );
/**********************************************************************
*
* @function:
* FT_ClassicKern_Free
*
* @description:
* Free the buffer allocated by classic Kern validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_ClassicKern_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_ClassicKern_Validate only.
*/
/**************************************************************************
*
* @function:
* FT_ClassicKern_Free
*
* @description:
* Free the buffer allocated by classic Kern validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_ClassicKern_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_ClassicKern_Validate only.
*/
FT_EXPORT( void )
FT_ClassicKern_Free( FT_Face face,
FT_Bytes table );

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftgzip.h */
/* */
/* Gzip-compressed stream support. */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftgzip.h
*
* Gzip-compressed stream support.
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTGZIP_H_
@ -31,108 +31,108 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* gzip */
/* */
/* <Title> */
/* GZIP Streams */
/* */
/* <Abstract> */
/* Using gzip-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of Gzip-specific functions. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* gzip
*
* @title:
* GZIP Streams
*
* @abstract:
* Using gzip-compressed font files.
*
* @description:
* This section contains the declaration of Gzip-specific functions.
*
*/
/************************************************************************
*
* @function:
* FT_Stream_OpenGzip
*
* @description:
* Open a new stream to parse gzip-compressed font files. This is
* mainly used to support the compressed `*.pcf.gz' fonts that come
* with XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, gzip compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a gzipped stream from
* it and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with zlib support.
*/
/**************************************************************************
*
* @function:
* FT_Stream_OpenGzip
*
* @description:
* Open a new stream to parse gzip-compressed font files. This is mainly
* used to support the compressed `*.pcf.gz` fonts that come with
* XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close` on the new stream will
* **not** call `FT_Stream_Close` on the source stream. None of the
* stream objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, gzip compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a gzipped stream from it
* and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with zlib support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenGzip( FT_Stream stream,
FT_Stream source );
/************************************************************************
*
* @function:
* FT_Gzip_Uncompress
*
* @description:
* Decompress a zipped input buffer into an output buffer. This function
* is modeled after zlib's `uncompress' function.
*
* @input:
* memory ::
* A FreeType memory handle.
*
* input ::
* The input buffer.
*
* input_len ::
* The length of the input buffer.
*
* @output:
* output::
* The output buffer.
*
* @inout:
* output_len ::
* Before calling the function, this is the total size of the output
* buffer, which must be large enough to hold the entire uncompressed
* data (so the size of the uncompressed data must be known in
* advance). After calling the function, `output_len' is the size of
* the used data in `output'.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with zlib support.
*
* @since:
* 2.5.1
*/
/**************************************************************************
*
* @function:
* FT_Gzip_Uncompress
*
* @description:
* Decompress a zipped input buffer into an output buffer. This function
* is modeled after zlib's `uncompress` function.
*
* @input:
* memory ::
* A FreeType memory handle.
*
* input ::
* The input buffer.
*
* input_len ::
* The length of the input buffer.
*
* @output:
* output ::
* The output buffer.
*
* @inout:
* output_len ::
* Before calling the function, this is the total size of the output
* buffer, which must be large enough to hold the entire uncompressed
* data (so the size of the uncompressed data must be known in
* advance). After calling the function, `output_len` is the size of
* the used data in `output`.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with zlib support.
*
* @since:
* 2.5.1
*/
FT_EXPORT( FT_Error )
FT_Gzip_Uncompress( FT_Memory memory,
FT_Byte* output,

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftincrem.h */
/* */
/* FreeType incremental loading (specification). */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftincrem.h
*
* FreeType incremental loading (specification).
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTINCREM_H_
@ -32,7 +32,7 @@
FT_BEGIN_HEADER
/***************************************************************************
/**************************************************************************
*
* @section:
* incremental
@ -45,7 +45,7 @@ FT_BEGIN_HEADER
*
* @description:
* This section contains various functions used to perform so-called
* `incremental' glyph loading. This is a mode where all glyphs loaded
* 'incremental' glyph loading. This is a mode where all glyphs loaded
* from a given @FT_Face are provided by the client application.
*
* Apart from that, all other tables are loaded normally from the font
@ -60,23 +60,24 @@ FT_BEGIN_HEADER
*/
/***************************************************************************
/**************************************************************************
*
* @type:
* FT_Incremental
*
* @description:
* An opaque type describing a user-provided object used to implement
* `incremental' glyph loading within FreeType. This is used to support
* embedded fonts in certain environments (e.g., PostScript interpreters),
* where the glyph data isn't in the font file, or must be overridden by
* different values.
* 'incremental' glyph loading within FreeType. This is used to support
* embedded fonts in certain environments (e.g., PostScript
* interpreters), where the glyph data isn't in the font file, or must be
* overridden by different values.
*
* @note:
* It is up to client applications to create and implement @FT_Incremental
* objects, as long as they provide implementations for the methods
* @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
* and @FT_Incremental_GetGlyphMetricsFunc.
* It is up to client applications to create and implement
* @FT_Incremental objects, as long as they provide implementations for
* the methods @FT_Incremental_GetGlyphDataFunc,
* @FT_Incremental_FreeGlyphDataFunc and
* @FT_Incremental_GetGlyphMetricsFunc.
*
* See the description of @FT_Incremental_InterfaceRec to understand how
* to use incremental objects with FreeType.
@ -85,14 +86,14 @@ FT_BEGIN_HEADER
typedef struct FT_IncrementalRec_* FT_Incremental;
/***************************************************************************
/**************************************************************************
*
* @struct:
* FT_Incremental_MetricsRec
*
* @description:
* A small structure used to contain the basic glyph metrics returned
* by the @FT_Incremental_GetGlyphMetricsFunc method.
* A small structure used to contain the basic glyph metrics returned by
* the @FT_Incremental_GetGlyphMetricsFunc method.
*
* @fields:
* bearing_x ::
@ -109,7 +110,7 @@ FT_BEGIN_HEADER
*
* @note:
* These correspond to horizontal or vertical metrics depending on the
* value of the `vertical' argument to the function
* value of the `vertical` argument to the function
* @FT_Incremental_GetGlyphMetricsFunc.
*
*/
@ -123,7 +124,7 @@ FT_BEGIN_HEADER
} FT_Incremental_MetricsRec;
/***************************************************************************
/**************************************************************************
*
* @struct:
* FT_Incremental_Metrics
@ -135,7 +136,7 @@ FT_BEGIN_HEADER
typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
/***************************************************************************
/**************************************************************************
*
* @type:
* FT_Incremental_GetGlyphDataFunc
@ -147,8 +148,8 @@ FT_BEGIN_HEADER
*
* Note that the format of the glyph's data bytes depends on the font
* file format. For TrueType, it must correspond to the raw bytes within
* the `glyf' table. For PostScript formats, it must correspond to the
* *unencrypted* charstring bytes, without any `lenIV' header. It is
* the 'glyf' table. For PostScript formats, it must correspond to the
* **unencrypted** charstring bytes, without any `lenIV` header. It is
* undefined for any other format.
*
* @input:
@ -169,8 +170,8 @@ FT_BEGIN_HEADER
*
* @note:
* If this function returns successfully the method
* @FT_Incremental_FreeGlyphDataFunc will be called later to release
* the data bytes.
* @FT_Incremental_FreeGlyphDataFunc will be called later to release the
* data bytes.
*
* Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
* compound glyphs.
@ -182,7 +183,7 @@ FT_BEGIN_HEADER
FT_Data* adata );
/***************************************************************************
/**************************************************************************
*
* @type:
* FT_Incremental_FreeGlyphDataFunc
@ -206,7 +207,7 @@ FT_BEGIN_HEADER
FT_Data* data );
/***************************************************************************
/**************************************************************************
*
* @type:
* FT_Incremental_GetGlyphMetricsFunc
@ -214,8 +215,8 @@ FT_BEGIN_HEADER
* @description:
* A function used to retrieve the basic metrics of a given glyph index
* before accessing its data. This is necessary because, in certain
* formats like TrueType, the metrics are stored in a different place from
* the glyph images proper.
* formats like TrueType, the metrics are stored in a different place
* from the glyph images proper.
*
* @input:
* incremental ::
@ -229,9 +230,9 @@ FT_BEGIN_HEADER
* If true, return vertical metrics.
*
* ametrics ::
* This parameter is used for both input and output.
* The original glyph metrics, if any, in font units. If metrics are
* not available all the values must be set to zero.
* This parameter is used for both input and output. The original
* glyph metrics, if any, in font units. If metrics are not available
* all the values must be set to zero.
*
* @output:
* ametrics ::
@ -252,8 +253,8 @@ FT_BEGIN_HEADER
* FT_Incremental_FuncsRec
*
* @description:
* A table of functions for accessing fonts that load data
* incrementally. Used in @FT_Incremental_InterfaceRec.
* A table of functions for accessing fonts that load data incrementally.
* Used in @FT_Incremental_InterfaceRec.
*
* @fields:
* get_glyph_data ::
@ -263,8 +264,8 @@ FT_BEGIN_HEADER
* The function to release glyph data. Must not be null.
*
* get_glyph_metrics ::
* The function to get glyph metrics. May be null if the font does
* not provide overriding glyph metrics.
* The function to get glyph metrics. May be null if the font does not
* provide overriding glyph metrics.
*
*/
typedef struct FT_Incremental_FuncsRec_
@ -276,7 +277,7 @@ FT_BEGIN_HEADER
} FT_Incremental_FuncsRec;
/***************************************************************************
/**************************************************************************
*
* @struct:
* FT_Incremental_InterfaceRec
@ -286,30 +287,30 @@ FT_BEGIN_HEADER
* wants to support incremental glyph loading. You should use it with
* @FT_PARAM_TAG_INCREMENTAL as in the following example:
*
* {
* FT_Incremental_InterfaceRec inc_int;
* FT_Parameter parameter;
* FT_Open_Args open_args;
* ```
* FT_Incremental_InterfaceRec inc_int;
* FT_Parameter parameter;
* FT_Open_Args open_args;
*
*
* // set up incremental descriptor
* inc_int.funcs = my_funcs;
* inc_int.object = my_object;
* // set up incremental descriptor
* inc_int.funcs = my_funcs;
* inc_int.object = my_object;
*
* // set up optional parameter
* parameter.tag = FT_PARAM_TAG_INCREMENTAL;
* parameter.data = &inc_int;
* // set up optional parameter
* parameter.tag = FT_PARAM_TAG_INCREMENTAL;
* parameter.data = &inc_int;
*
* // set up FT_Open_Args structure
* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
* open_args.pathname = my_font_pathname;
* open_args.num_params = 1;
* open_args.params = &parameter; // we use one optional argument
* // set up FT_Open_Args structure
* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
* open_args.pathname = my_font_pathname;
* open_args.num_params = 1;
* open_args.params = &parameter; // we use one optional argument
*
* // open the font
* error = FT_Open_Face( library, &open_args, index, &face );
* ...
* }
* // open the font
* error = FT_Open_Face( library, &open_args, index, &face );
* ...
* ```
*
*/
typedef struct FT_Incremental_InterfaceRec_
@ -320,7 +321,7 @@ FT_BEGIN_HEADER
} FT_Incremental_InterfaceRec;
/***************************************************************************
/**************************************************************************
*
* @type:
* FT_Incremental_Interface

View File

@ -1,20 +1,20 @@
/***************************************************************************/
/* */
/* ftlcdfil.h */
/* */
/* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */
/* */
/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftlcdfil.h
*
* FreeType API for color filtering of subpixel bitmap glyphs
* (specification).
*
* Copyright (C) 2006-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTLCDFIL_H_
@ -33,105 +33,98 @@
FT_BEGIN_HEADER
/***************************************************************************
/**************************************************************************
*
* @section:
* lcd_filtering
* lcd_rendering
*
* @title:
* LCD Filtering
* Subpixel Rendering
*
* @abstract:
* Reduce color fringes of subpixel-rendered bitmaps.
* API to control subpixel rendering.
*
* @description:
* Should you #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your
* `ftoption.h', which enables patented ClearType-style rendering,
* the LCD-optimized glyph bitmaps should be filtered to reduce color
* fringes inherent to this technology. The default FreeType LCD
* rendering uses different technology, and API described below,
* although available, does nothing.
* FreeType provides two alternative subpixel rendering technologies.
* Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
* `ftoption.h` file, this enables patented ClearType-style rendering.
* Otherwise, Harmony LCD rendering is enabled. These technologies are
* controlled differently and API described below, although always
* available, performs its function when appropriate method is enabled
* and does nothing otherwise.
*
* ClearType-style LCD rendering exploits the color-striped structure of
* LCD pixels, increasing the available resolution in the direction of
* the stripe (usually horizontal RGB) by a factor of~3. Since these
* subpixels are color pixels, using them unfiltered creates severe
* color fringes. Use the @FT_Library_SetLcdFilter API to specify a
* low-pass filter, which is then applied to subpixel-rendered bitmaps
* generated through @FT_Render_Glyph. The filter sacrifices some of
* the higher resolution to reduce color fringes, making the glyph image
* slightly blurrier. Positional improvements will remain.
* the stripe (usually horizontal RGB) by a factor of~3. Using the
* subpixels coverages unfiltered can create severe color fringes
* especially when rendering thin features. Indeed, to produce
* black-on-white text, the nearby color subpixels must be dimmed
* equally.
*
* A filter should have two properties:
* A good 5-tap FIR filter should be applied to subpixel coverages
* regardless of pixel boundaries and should have these properties:
*
* 1) It should be normalized, meaning the sum of the 5~components
* should be 256 (0x100). It is possible to go above or under this
* target sum, however: going under means tossing out contrast, going
* over means invoking clamping and thereby non-linearities that
* increase contrast somewhat at the expense of greater distortion
* and color-fringing. Contrast is better enhanced through stem
* darkening.
* 1. It should be symmetrical, like {~a, b, c, b, a~}, to avoid
* any shifts in appearance.
*
* 2) It should be color-balanced, meaning a filter `{~a, b, c, b, a~}'
* where a~+ b~=~c. It distributes the computed coverage for one
* subpixel to all subpixels equally, sacrificing some won resolution
* but drastically reducing color-fringing. Positioning improvements
* remain! Note that color-fringing can only really be minimized
* when using a color-balanced filter and alpha-blending the glyph
* onto a surface in linear space; see @FT_Render_Glyph.
* 2. It should be color-balanced, meaning a~+ b~=~c, to reduce color
* fringes by distributing the computed coverage for one subpixel to
* all subpixels equally.
*
* Regarding the form, a filter can be a `boxy' filter or a `beveled'
* filter. Boxy filters are sharper but are less forgiving of non-ideal
* gamma curves of a screen (viewing angles!), beveled filters are
* fuzzier but more tolerant.
* 3. It should be normalized, meaning 2a~+ 2b~+ c~=~1.0 to maintain
* overall brightness.
*
* Examples:
* Boxy 3-tap filter {0, 1/3, 1/3, 1/3, 0} is sharper but is less
* forgiving of non-ideal gamma curves of a screen (and viewing angles),
* beveled filters are fuzzier but more tolerant.
*
* - [0x10 0x40 0x70 0x40 0x10] is beveled and neither balanced nor
* normalized.
* Use the @FT_Library_SetLcdFilter or @FT_Library_SetLcdFilterWeights
* API to specify a low-pass filter, which is then applied to
* subpixel-rendered bitmaps generated through @FT_Render_Glyph.
*
* - [0x1A 0x33 0x4D 0x33 0x1A] is beveled and balanced but not
* normalized.
* Harmony LCD rendering is suitable to panels with any regular subpixel
* structure, not just monitors with 3 color striped subpixels, as long
* as the color subpixels have fixed positions relative to the pixel
* center. In this case, each color channel is then rendered separately
* after shifting the outline opposite to the subpixel shift so that the
* coverage maps are aligned. This method is immune to color fringes
* because the shifts do not change integral coverage.
*
* - [0x19 0x33 0x66 0x4c 0x19] is beveled and normalized but not
* balanced.
* The subpixel geometry must be specified by xy-coordinates for each
* subpixel. By convention they may come in the RGB order: {{-1/3, 0},
* {0, 0}, {1/3, 0}} for standard RGB striped panel or {{-1/6, 1/4},
* {-1/6, -1/4}, {1/3, 0}} for a certain PenTile panel.
*
* - [0x00 0x4c 0x66 0x4c 0x00] is boxily beveled and normalized but not
* balanced.
* Use the @FT_Library_SetLcdGeometry API to specify subpixel positions.
* If one follows the RGB order convention, the same order applies to the
* resulting @FT_PIXEL_MODE_LCD and @FT_PIXEL_MODE_LCD_V bitmaps. Note,
* however, that the coordinate frame for the latter must be rotated
* clockwise. Harmony with default LCD geometry is equivalent to
* ClearType with light filter.
*
* - [0x00 0x55 0x56 0x55 0x00] is boxy, normalized, and almost
* balanced.
* As a result of ClearType filtering or Harmony rendering, the
* dimensions of LCD bitmaps can be either wider or taller than the
* dimensions of the corresponding outline with regard to the pixel grid.
* For example, for @FT_RENDER_MODE_LCD, the filter adds 2~subpixels to
* the left, and 2~subpixels to the right. The bitmap offset values are
* adjusted accordingly, so clients shouldn't need to modify their layout
* and glyph positioning code when enabling the filter.
*
* - [0x08 0x4D 0x56 0x4D 0x08] is beveled, normalized and, almost
* balanced.
* The ClearType and Harmony rendering is applicable to glyph bitmaps
* rendered through @FT_Render_Glyph, @FT_Load_Glyph, @FT_Load_Char, and
* @FT_Glyph_To_Bitmap, when @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V
* is specified. This API does not control @FT_Outline_Render and
* @FT_Outline_Get_Bitmap.
*
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
* @FT_Load_Glyph, and @FT_Load_Char. It does _not_ affect the output
* of @FT_Outline_Render and @FT_Outline_Get_Bitmap.
*
* If this feature is activated, the dimensions of LCD glyph bitmaps are
* either wider or taller than the dimensions of the corresponding
* outline with regard to the pixel grid. For example, for
* @FT_RENDER_MODE_LCD, the filter adds 3~subpixels to the left, and
* 3~subpixels to the right. The bitmap offset values are adjusted
* accordingly, so clients shouldn't need to modify their layout and
* glyph positioning code when enabling the filter.
*
* It is important to understand that linear alpha blending and gamma
* correction is critical for correctly rendering glyphs onto surfaces
* without artifacts and even more critical when subpixel rendering is
* involved.
*
* Each of the 3~alpha values (subpixels) is independently used to blend
* one color channel. That is, red alpha blends the red channel of the
* text color with the red channel of the background pixel. The
* distribution of density values by the color-balanced filter assumes
* alpha blending is done in linear space; only then color artifacts
* cancel out.
* The described algorithms can completely remove color artefacts when
* combined with gamma-corrected alpha blending in linear space. Each of
* the 3~alpha values (subpixels) must by independently used to blend one
* color channel. That is, red alpha blends the red channel of the text
* color with the red channel of the background pixel.
*/
/****************************************************************************
/**************************************************************************
*
* @enum:
* FT_LcdFilter
@ -145,47 +138,25 @@ FT_BEGIN_HEADER
* results in sometimes severe color fringes.
*
* FT_LCD_FILTER_DEFAULT ::
* The default filter reduces color fringes considerably, at the cost
* of a slight blurriness in the output.
*
* It is a beveled, normalized, and color-balanced five-tap filter
* that is more forgiving to screens with non-ideal gamma curves and
* viewing angles. Note that while color-fringing is reduced, it can
* only be minimized by using linear alpha blending and gamma
* correction to render glyphs onto surfaces. The default filter
* weights are [0x08 0x4D 0x56 0x4D 0x08].
* This is a beveled, normalized, and color-balanced five-tap filter
* with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256th units.
*
* FT_LCD_FILTER_LIGHT ::
* The light filter is a variant that is sharper at the cost of
* slightly more color fringes than the default one.
*
* It is a boxy, normalized, and color-balanced three-tap filter that
* is less forgiving to screens with non-ideal gamma curves and
* viewing angles. This filter works best when the rendering system
* uses linear alpha blending and gamma correction to render glyphs
* onto surfaces. The light filter weights are
* [0x00 0x55 0x56 0x55 0x00].
* this is a boxy, normalized, and color-balanced three-tap filter with
* weights of [0x00 0x55 0x56 0x55 0x00] in 1/256th units.
*
* FT_LCD_FILTER_LEGACY ::
* FT_LCD_FILTER_LEGACY1 ::
* This filter corresponds to the original libXft color filter. It
* provides high contrast output but can exhibit really bad color
* fringes if glyphs are not extremely well hinted to the pixel grid.
* In other words, it only works well if the TrueType bytecode
* interpreter is enabled *and* high-quality hinted fonts are used.
*
* This filter is only provided for comparison purposes, and might be
* disabled or stay unsupported in the future.
*
* FT_LCD_FILTER_LEGACY1 ::
* For historical reasons, the FontConfig library returns a different
* enumeration value for legacy LCD filtering. To make code work that
* (incorrectly) forwards FontConfig's enumeration value to
* @FT_Library_SetLcdFilter without proper mapping, it is thus easiest
* to have another enumeration value, which is completely equal to
* `FT_LCD_FILTER_LEGACY'.
* disabled or stay unsupported in the future. The second value is
* provided for compatibility with FontConfig, which historically used
* different enumeration, sometimes incorrectly forwarded to FreeType.
*
* @since:
* 2.3.0 (`FT_LCD_FILTER_LEGACY1' since 2.6.2)
* 2.3.0 (`FT_LCD_FILTER_LEGACY1` since 2.6.2)
*/
typedef enum FT_LcdFilter_
{
@ -202,7 +173,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @func:
* @function:
* FT_Library_SetLcdFilter
*
* @description:
@ -218,20 +189,20 @@ FT_BEGIN_HEADER
* The filter type.
*
* You can use @FT_LCD_FILTER_NONE here to disable this feature, or
* @FT_LCD_FILTER_DEFAULT to use a default filter that should work
* well on most LCD screens.
* @FT_LCD_FILTER_DEFAULT to use a default filter that should work well
* on most LCD screens.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This feature is always disabled by default. Clients must make an
* explicit call to this function with a `filter' value other than
* explicit call to this function with a `filter` value other than
* @FT_LCD_FILTER_NONE in order to enable it.
*
* Due to *PATENTS* covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
* Due to **PATENTS** covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature` if the
* configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
@ -245,7 +216,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @func:
* @function:
* FT_Library_SetLcdFilterWeights
*
* @description:
@ -258,15 +229,15 @@ FT_BEGIN_HEADER
*
* weights ::
* A pointer to an array; the function copies the first five bytes and
* uses them to specify the filter weights.
* uses them to specify the filter weights in 1/256th units.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Due to *PATENTS* covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
* Due to **PATENTS** covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature` if the
* configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
@ -281,7 +252,8 @@ FT_BEGIN_HEADER
unsigned char *weights );
/*
/**************************************************************************
*
* @type:
* FT_LcdFiveTapFilter
*
@ -298,6 +270,53 @@ FT_BEGIN_HEADER
typedef FT_Byte FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS];
/**************************************************************************
*
* @function:
* FT_Library_SetLcdGeometry
*
* @description:
* This function can be used to modify default positions of color
* subpixels, which controls Harmony LCD rendering.
*
* @input:
* library ::
* A handle to the target library instance.
*
* sub ::
* A pointer to an array of 3 vectors in 26.6 fractional pixel format;
* the function modifies the default values, see the note below.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Subpixel geometry examples:
*
* - {{-21, 0}, {0, 0}, {21, 0}} is the default, corresponding to 3 color
* stripes shifted by a third of a pixel. This could be an RGB panel.
*
* - {{21, 0}, {0, 0}, {-21, 0}} looks the same as the default but can
* specify a BGR panel instead, while keeping the bitmap in the same
* RGB888 format.
*
* - {{0, 21}, {0, 0}, {0, -21}} is the vertical RGB, but the bitmap
* stays RGB888 as a result.
*
* - {{-11, 16}, {-11, -16}, {22, 0}} is a certain PenTile arrangement.
*
* This function does nothing and returns `FT_Err_Unimplemented_Feature`
* in the context of ClearType-style subpixel rendering when
* `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is defined in your build of the
* library.
*
* @since:
* 2.10.0
*/
FT_EXPORT( FT_Error )
FT_Library_SetLcdGeometry( FT_Library library,
FT_Vector sub[3] );
/* */

View File

@ -1,27 +1,27 @@
/***************************************************************************/
/* */
/* ftlist.h */
/* */
/* Generic list support for FreeType (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftlist.h
*
* Generic list support for FreeType (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* This file implements functions relative to list processing. Its */
/* data structures are defined in `freetype.h'. */
/* */
/*************************************************************************/
/**************************************************************************
*
* This file implements functions relative to list processing. Its data
* structures are defined in `freetype.h`.
*
*/
#ifndef FTLIST_H_
@ -41,224 +41,245 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* list_processing */
/* */
/* <Title> */
/* List Processing */
/* */
/* <Abstract> */
/* Simple management of lists. */
/* */
/* <Description> */
/* This section contains various definitions related to list */
/* processing using doubly-linked nodes. */
/* */
/* <Order> */
/* FT_List */
/* FT_ListNode */
/* FT_ListRec */
/* FT_ListNodeRec */
/* */
/* FT_List_Add */
/* FT_List_Insert */
/* FT_List_Find */
/* FT_List_Remove */
/* FT_List_Up */
/* FT_List_Iterate */
/* FT_List_Iterator */
/* FT_List_Finalize */
/* FT_List_Destructor */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* list_processing
*
* @title:
* List Processing
*
* @abstract:
* Simple management of lists.
*
* @description:
* This section contains various definitions related to list processing
* using doubly-linked nodes.
*
* @order:
* FT_List
* FT_ListNode
* FT_ListRec
* FT_ListNodeRec
*
* FT_List_Add
* FT_List_Insert
* FT_List_Find
* FT_List_Remove
* FT_List_Up
* FT_List_Iterate
* FT_List_Iterator
* FT_List_Finalize
* FT_List_Destructor
*
*/
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Find */
/* */
/* <Description> */
/* Find the list node for a given listed object. */
/* */
/* <Input> */
/* list :: A pointer to the parent list. */
/* data :: The address of the listed object. */
/* */
/* <Return> */
/* List node. NULL if it wasn't found. */
/* */
/**************************************************************************
*
* @function:
* FT_List_Find
*
* @description:
* Find the list node for a given listed object.
*
* @input:
* list ::
* A pointer to the parent list.
* data ::
* The address of the listed object.
*
* @return:
* List node. `NULL` if it wasn't found.
*/
FT_EXPORT( FT_ListNode )
FT_List_Find( FT_List list,
void* data );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Add */
/* */
/* <Description> */
/* Append an element to the end of a list. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* node :: The node to append. */
/* */
/**************************************************************************
*
* @function:
* FT_List_Add
*
* @description:
* Append an element to the end of a list.
*
* @inout:
* list ::
* A pointer to the parent list.
* node ::
* The node to append.
*/
FT_EXPORT( void )
FT_List_Add( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Insert */
/* */
/* <Description> */
/* Insert an element at the head of a list. */
/* */
/* <InOut> */
/* list :: A pointer to parent list. */
/* node :: The node to insert. */
/* */
/**************************************************************************
*
* @function:
* FT_List_Insert
*
* @description:
* Insert an element at the head of a list.
*
* @inout:
* list ::
* A pointer to parent list.
* node ::
* The node to insert.
*/
FT_EXPORT( void )
FT_List_Insert( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Remove */
/* */
/* <Description> */
/* Remove a node from a list. This function doesn't check whether */
/* the node is in the list! */
/* */
/* <Input> */
/* node :: The node to remove. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* */
/**************************************************************************
*
* @function:
* FT_List_Remove
*
* @description:
* Remove a node from a list. This function doesn't check whether the
* node is in the list!
*
* @input:
* node ::
* The node to remove.
*
* @inout:
* list ::
* A pointer to the parent list.
*/
FT_EXPORT( void )
FT_List_Remove( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Up */
/* */
/* <Description> */
/* Move a node to the head/top of a list. Used to maintain LRU */
/* lists. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* node :: The node to move. */
/* */
/**************************************************************************
*
* @function:
* FT_List_Up
*
* @description:
* Move a node to the head/top of a list. Used to maintain LRU lists.
*
* @inout:
* list ::
* A pointer to the parent list.
* node ::
* The node to move.
*/
FT_EXPORT( void )
FT_List_Up( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_List_Iterator */
/* */
/* <Description> */
/* An FT_List iterator function that is called during a list parse */
/* by @FT_List_Iterate. */
/* */
/* <Input> */
/* node :: The current iteration list node. */
/* */
/* user :: A typeless pointer passed to @FT_List_Iterate. */
/* Can be used to point to the iteration's state. */
/* */
/**************************************************************************
*
* @functype:
* FT_List_Iterator
*
* @description:
* An FT_List iterator function that is called during a list parse by
* @FT_List_Iterate.
*
* @input:
* node ::
* The current iteration list node.
*
* user ::
* A typeless pointer passed to @FT_List_Iterate. Can be used to point
* to the iteration's state.
*/
typedef FT_Error
(*FT_List_Iterator)( FT_ListNode node,
void* user );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Iterate */
/* */
/* <Description> */
/* Parse a list and calls a given iterator function on each element. */
/* Note that parsing is stopped as soon as one of the iterator calls */
/* returns a non-zero value. */
/* */
/* <Input> */
/* list :: A handle to the list. */
/* iterator :: An iterator function, called on each node of the list. */
/* user :: A user-supplied field that is passed as the second */
/* argument to the iterator. */
/* */
/* <Return> */
/* The result (a FreeType error code) of the last iterator call. */
/* */
/**************************************************************************
*
* @function:
* FT_List_Iterate
*
* @description:
* Parse a list and calls a given iterator function on each element.
* Note that parsing is stopped as soon as one of the iterator calls
* returns a non-zero value.
*
* @input:
* list ::
* A handle to the list.
* iterator ::
* An iterator function, called on each node of the list.
* user ::
* A user-supplied field that is passed as the second argument to the
* iterator.
*
* @return:
* The result (a FreeType error code) of the last iterator call.
*/
FT_EXPORT( FT_Error )
FT_List_Iterate( FT_List list,
FT_List_Iterator iterator,
void* user );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_List_Destructor */
/* */
/* <Description> */
/* An @FT_List iterator function that is called during a list */
/* finalization by @FT_List_Finalize to destroy all elements in a */
/* given list. */
/* */
/* <Input> */
/* system :: The current system object. */
/* */
/* data :: The current object to destroy. */
/* */
/* user :: A typeless pointer passed to @FT_List_Iterate. It can */
/* be used to point to the iteration's state. */
/* */
/**************************************************************************
*
* @functype:
* FT_List_Destructor
*
* @description:
* An @FT_List iterator function that is called during a list
* finalization by @FT_List_Finalize to destroy all elements in a given
* list.
*
* @input:
* system ::
* The current system object.
*
* data ::
* The current object to destroy.
*
* user ::
* A typeless pointer passed to @FT_List_Iterate. It can be used to
* point to the iteration's state.
*/
typedef void
(*FT_List_Destructor)( FT_Memory memory,
void* data,
void* user );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Finalize */
/* */
/* <Description> */
/* Destroy all elements in the list as well as the list itself. */
/* */
/* <Input> */
/* list :: A handle to the list. */
/* */
/* destroy :: A list destructor that will be applied to each element */
/* of the list. Set this to NULL if not needed. */
/* */
/* memory :: The current memory object that handles deallocation. */
/* */
/* user :: A user-supplied field that is passed as the last */
/* argument to the destructor. */
/* */
/* <Note> */
/* This function expects that all nodes added by @FT_List_Add or */
/* @FT_List_Insert have been dynamically allocated. */
/* */
/**************************************************************************
*
* @function:
* FT_List_Finalize
*
* @description:
* Destroy all elements in the list as well as the list itself.
*
* @input:
* list ::
* A handle to the list.
*
* destroy ::
* A list destructor that will be applied to each element of the list.
* Set this to `NULL` if not needed.
*
* memory ::
* The current memory object that handles deallocation.
*
* user ::
* A user-supplied field that is passed as the last argument to the
* destructor.
*
* @note:
* This function expects that all nodes added by @FT_List_Add or
* @FT_List_Insert have been dynamically allocated.
*/
FT_EXPORT( void )
FT_List_Finalize( FT_List list,
FT_List_Destructor destroy,

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftlzw.h */
/* */
/* LZW-compressed stream support. */
/* */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftlzw.h
*
* LZW-compressed stream support.
*
* Copyright (C) 2004-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTLZW_H_
@ -31,59 +31,60 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* lzw */
/* */
/* <Title> */
/* LZW Streams */
/* */
/* <Abstract> */
/* Using LZW-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of LZW-specific functions. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* lzw
*
* @title:
* LZW Streams
*
* @abstract:
* Using LZW-compressed font files.
*
* @description:
* This section contains the declaration of LZW-specific functions.
*
*/
/************************************************************************
*
* @function:
* FT_Stream_OpenLZW
*
* @description:
* Open a new stream to parse LZW-compressed font files. This is
* mainly used to support the compressed `*.pcf.Z' fonts that come
* with XFree86.
*
* @input:
* stream :: The target embedding stream.
*
* source :: The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream
*
* In certain builds of the library, LZW compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a LZW stream from it
* and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with LZW support.
*/
/**************************************************************************
*
* @function:
* FT_Stream_OpenLZW
*
* @description:
* Open a new stream to parse LZW-compressed font files. This is mainly
* used to support the compressed `*.pcf.Z` fonts that come with XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close` on the new stream will
* **not** call `FT_Stream_Close` on the source stream. None of the
* stream objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream
*
* In certain builds of the library, LZW compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a LZW stream from it and
* re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with LZW support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenLZW( FT_Stream stream,
FT_Stream source );

View File

@ -1,28 +1,28 @@
/***************************************************************************/
/* */
/* ftmac.h */
/* */
/* Additional Mac-specific API. */
/* */
/* Copyright 1996-2018 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftmac.h
*
* Additional Mac-specific API.
*
* Copyright (C) 1996-2019 by
* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/***************************************************************************/
/* */
/* NOTE: Include this file after FT_FREETYPE_H and after any */
/* Mac-specific headers (because this header uses Mac types such as */
/* Handle, FSSpec, FSRef, etc.) */
/* */
/***************************************************************************/
/****************************************************************************
*
* NOTE: Include this file after `FT_FREETYPE_H` and after any
* Mac-specific headers (because this header uses Mac types such as
* 'Handle', 'FSSpec', 'FSRef', etc.)
*
*/
#ifndef FTMAC_H_
@ -47,56 +47,59 @@ FT_BEGIN_HEADER
#endif
/*************************************************************************/
/* */
/* <Section> */
/* mac_specific */
/* */
/* <Title> */
/* Mac Specific Interface */
/* */
/* <Abstract> */
/* Only available on the Macintosh. */
/* */
/* <Description> */
/* The following definitions are only available if FreeType is */
/* compiled on a Macintosh. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* mac_specific
*
* @title:
* Mac Specific Interface
*
* @abstract:
* Only available on the Macintosh.
*
* @description:
* The following definitions are only available if FreeType is compiled
* on a Macintosh.
*
*/
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FOND */
/* */
/* <Description> */
/* Create a new face object from a FOND resource. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* fond :: A FOND resource. */
/* */
/* face_index :: Only supported for the -1 `sanity check' special */
/* case. */
/* */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Notes> */
/* This function can be used to create @FT_Face objects from fonts */
/* that are installed in the system as follows. */
/* */
/* { */
/* fond = GetResource( 'FOND', fontName ); */
/* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
/* } */
/* */
/**************************************************************************
*
* @function:
* FT_New_Face_From_FOND
*
* @description:
* Create a new face object from a FOND resource.
*
* @inout:
* library ::
* A handle to the library resource.
*
* @input:
* fond ::
* A FOND resource.
*
* face_index ::
* Only supported for the -1 'sanity check' special case.
*
* @output:
* aface ::
* A handle to a new face object.
*
* @return:
* FreeType error code. 0~means success.
*
* @example:
* This function can be used to create @FT_Face objects from fonts that
* are installed in the system as follows.
*
* ```
* fond = GetResource( 'FOND', fontName );
* error = FT_New_Face_From_FOND( library, fond, 0, &face );
* ```
*/
FT_EXPORT( FT_Error )
FT_New_Face_From_FOND( FT_Library library,
Handle fond,
@ -105,28 +108,28 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFile_From_Mac_Name */
/* */
/* <Description> */
/* Return an FSSpec for the disk file containing the named font. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font (e.g., Times New Roman */
/* Bold). */
/* */
/* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/**************************************************************************
*
* @function:
* FT_GetFile_From_Mac_Name
*
* @description:
* Return an FSSpec for the disk file containing the named font.
*
* @input:
* fontName ::
* Mac OS name of the font (e.g., Times New Roman Bold).
*
* @output:
* pathSpec ::
* FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
*
* face_index ::
* Index of the face. For passing to @FT_New_Face_From_FSSpec.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_Name( const char* fontName,
FSSpec* pathSpec,
@ -134,27 +137,28 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFile_From_Mac_ATS_Name */
/* */
/* <Description> */
/* Return an FSSpec for the disk file containing the named font. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */
/* */
/* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/**************************************************************************
*
* @function:
* FT_GetFile_From_Mac_ATS_Name
*
* @description:
* Return an FSSpec for the disk file containing the named font.
*
* @input:
* fontName ::
* Mac OS name of the font in ATS framework.
*
* @output:
* pathSpec ::
* FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
*
* face_index ::
* Index of the face. For passing to @FT_New_Face_From_FSSpec.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
FSSpec* pathSpec,
@ -162,30 +166,33 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFilePath_From_Mac_ATS_Name */
/* */
/* <Description> */
/* Return a pathname of the disk file and face index for given font */
/* name that is handled by ATS framework. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */
/* */
/* <Output> */
/* path :: Buffer to store pathname of the file. For passing */
/* to @FT_New_Face. The client must allocate this */
/* buffer before calling this function. */
/* */
/* maxPathSize :: Lengths of the buffer `path' that client allocated. */
/* */
/* face_index :: Index of the face. For passing to @FT_New_Face. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/**************************************************************************
*
* @function:
* FT_GetFilePath_From_Mac_ATS_Name
*
* @description:
* Return a pathname of the disk file and face index for given font name
* that is handled by ATS framework.
*
* @input:
* fontName ::
* Mac OS name of the font in ATS framework.
*
* @output:
* path ::
* Buffer to store pathname of the file. For passing to @FT_New_Face.
* The client must allocate this buffer before calling this function.
*
* maxPathSize ::
* Lengths of the buffer `path` that client allocated.
*
* face_index ::
* Index of the face. For passing to @FT_New_Face.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT( FT_Error )
FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
UInt8* path,
@ -194,33 +201,37 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FSSpec */
/* */
/* <Description> */
/* Create a new face object from a given resource and typeface index */
/* using an FSSpec to the font file. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* spec :: FSSpec to the font file. */
/* */
/* face_index :: The index of the face within the resource. The */
/* first face has index~0. */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
/* it accepts an FSSpec instead of a path. */
/* */
/**************************************************************************
*
* @function:
* FT_New_Face_From_FSSpec
*
* @description:
* Create a new face object from a given resource and typeface index
* using an FSSpec to the font file.
*
* @inout:
* library ::
* A handle to the library resource.
*
* @input:
* spec ::
* FSSpec to the font file.
*
* face_index ::
* The index of the face within the resource. The first face has
* index~0.
* @output:
* aface ::
* A handle to a new face object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except it
* accepts an FSSpec instead of a path.
*/
FT_EXPORT( FT_Error )
FT_New_Face_From_FSSpec( FT_Library library,
const FSSpec *spec,
@ -229,33 +240,37 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FSRef */
/* */
/* <Description> */
/* Create a new face object from a given resource and typeface index */
/* using an FSRef to the font file. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* spec :: FSRef to the font file. */
/* */
/* face_index :: The index of the face within the resource. The */
/* first face has index~0. */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
/* it accepts an FSRef instead of a path. */
/* */
/**************************************************************************
*
* @function:
* FT_New_Face_From_FSRef
*
* @description:
* Create a new face object from a given resource and typeface index
* using an FSRef to the font file.
*
* @inout:
* library ::
* A handle to the library resource.
*
* @input:
* spec ::
* FSRef to the font file.
*
* face_index ::
* The index of the face within the resource. The first face has
* index~0.
* @output:
* aface ::
* A handle to a new face object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* @FT_New_Face_From_FSRef is identical to @FT_New_Face except it accepts
* an FSRef instead of a path.
*/
FT_EXPORT( FT_Error )
FT_New_Face_From_FSRef( FT_Library library,
const FSRef *ref,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,94 +1,103 @@
/***************************************************************************/
/* */
/* ftmoderr.h */
/* */
/* FreeType module error offsets (specification). */
/* */
/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftmoderr.h
*
* FreeType module error offsets (specification).
*
* Copyright (C) 2001-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* This file is used to define the FreeType module error codes. */
/* */
/* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is */
/* set, the lower byte of an error value identifies the error code as */
/* usual. In addition, the higher byte identifies the module. For */
/* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */
/* error `TT_Err_Invalid_File_Format' has value 0x1303, the error */
/* `T1_Err_Invalid_File_Format' has value 0x1403, etc. */
/* */
/* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero, */
/* including the high byte. */
/* */
/* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of */
/* an error value is set to zero. */
/* */
/* To hide the various `XXX_Err_' prefixes in the source code, FreeType */
/* provides some macros in `fttypes.h'. */
/* */
/* FT_ERR( err ) */
/* Add current error module prefix (as defined with the */
/* `FT_ERR_PREFIX' macro) to `err'. For example, in the BDF module */
/* the line */
/* */
/* error = FT_ERR( Invalid_Outline ); */
/* */
/* expands to */
/* */
/* error = BDF_Err_Invalid_Outline; */
/* */
/* For simplicity, you can always use `FT_Err_Ok' directly instead */
/* of `FT_ERR( Ok )'. */
/* */
/* FT_ERR_EQ( errcode, err ) */
/* FT_ERR_NEQ( errcode, err ) */
/* Compare error code `errcode' with the error `err' for equality */
/* and inequality, respectively. Example: */
/* */
/* if ( FT_ERR_EQ( error, Invalid_Outline ) ) */
/* ... */
/* */
/* Using this macro you don't have to think about error prefixes. */
/* Of course, if module errors are not active, the above example is */
/* the same as */
/* */
/* if ( error == FT_Err_Invalid_Outline ) */
/* ... */
/* */
/* FT_ERROR_BASE( errcode ) */
/* FT_ERROR_MODULE( errcode ) */
/* Get base error and module error code, respectively. */
/* */
/* */
/* It can also be used to create a module error message table easily */
/* with something like */
/* */
/* { */
/* #undef FTMODERR_H_ */
/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
/* #define FT_MODERR_START_LIST { */
/* #define FT_MODERR_END_LIST { 0, 0 } }; */
/* */
/* const struct */
/* { */
/* int mod_err_offset; */
/* const char* mod_err_msg */
/* } ft_mod_errors[] = */
/* */
/* #include FT_MODULE_ERRORS_H */
/* } */
/* */
/*************************************************************************/
/**************************************************************************
*
* This file is used to define the FreeType module error codes.
*
* If the macro `FT_CONFIG_OPTION_USE_MODULE_ERRORS` in `ftoption.h` is
* set, the lower byte of an error value identifies the error code as
* usual. In addition, the higher byte identifies the module. For
* example, the error `FT_Err_Invalid_File_Format` has value 0x0003, the
* error `TT_Err_Invalid_File_Format` has value 0x1303, the error
* `T1_Err_Invalid_File_Format` has value 0x1403, etc.
*
* Note that `FT_Err_Ok`, `TT_Err_Ok`, etc. are always equal to zero,
* including the high byte.
*
* If `FT_CONFIG_OPTION_USE_MODULE_ERRORS` isn't set, the higher byte of an
* error value is set to zero.
*
* To hide the various `XXX_Err_` prefixes in the source code, FreeType
* provides some macros in `fttypes.h`.
*
* FT_ERR( err )
*
* Add current error module prefix (as defined with the `FT_ERR_PREFIX`
* macro) to `err`. For example, in the BDF module the line
*
* ```
* error = FT_ERR( Invalid_Outline );
* ```
*
* expands to
*
* ```
* error = BDF_Err_Invalid_Outline;
* ```
*
* For simplicity, you can always use `FT_Err_Ok` directly instead of
* `FT_ERR( Ok )`.
*
* FT_ERR_EQ( errcode, err )
* FT_ERR_NEQ( errcode, err )
*
* Compare error code `errcode` with the error `err` for equality and
* inequality, respectively. Example:
*
* ```
* if ( FT_ERR_EQ( error, Invalid_Outline ) )
* ...
* ```
*
* Using this macro you don't have to think about error prefixes. Of
* course, if module errors are not active, the above example is the
* same as
*
* ```
* if ( error == FT_Err_Invalid_Outline )
* ...
* ```
*
* FT_ERROR_BASE( errcode )
* FT_ERROR_MODULE( errcode )
*
* Get base error and module error code, respectively.
*
* It can also be used to create a module error message table easily with
* something like
*
* ```
* #undef FTMODERR_H_
* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s },
* #define FT_MODERR_START_LIST {
* #define FT_MODERR_END_LIST { 0, 0 } };
*
* const struct
* {
* int mod_err_offset;
* const char* mod_err_msg
* } ft_mod_errors[] =
*
* #include FT_MODULE_ERRORS_H
* ```
*
*/
#ifndef FTMODERR_H_

View File

@ -1,30 +1,30 @@
/***************************************************************************/
/* */
/* ftotval.h */
/* */
/* FreeType API for validating OpenType tables (specification). */
/* */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftotval.h
*
* FreeType API for validating OpenType tables (specification).
*
* Copyright (C) 2004-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/***************************************************************************/
/* */
/* */
/* Warning: This module might be moved to a different library in the */
/* future to avoid a tight dependency between FreeType and the */
/* OpenType specification. */
/* */
/* */
/***************************************************************************/
/****************************************************************************
*
*
* Warning: This module might be moved to a different library in the
* future to avoid a tight dependency between FreeType and the
* OpenType specification.
*
*
*/
#ifndef FTOTVAL_H_
@ -43,62 +43,62 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* ot_validation */
/* */
/* <Title> */
/* OpenType Validation */
/* */
/* <Abstract> */
/* An API to validate OpenType tables. */
/* */
/* <Description> */
/* This section contains the declaration of functions to validate */
/* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
/* */
/* <Order> */
/* FT_OpenType_Validate */
/* FT_OpenType_Free */
/* */
/* FT_VALIDATE_OTXXX */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* ot_validation
*
* @title:
* OpenType Validation
*
* @abstract:
* An API to validate OpenType tables.
*
* @description:
* This section contains the declaration of functions to validate some
* OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
*
* @order:
* FT_OpenType_Validate
* FT_OpenType_Free
*
* FT_VALIDATE_OTXXX
*
*/
/**********************************************************************
*
* @enum:
* FT_VALIDATE_OTXXX
*
* @description:
* A list of bit-field constants used with @FT_OpenType_Validate to
* indicate which OpenType tables should be validated.
*
* @values:
* FT_VALIDATE_BASE ::
* Validate BASE table.
*
* FT_VALIDATE_GDEF ::
* Validate GDEF table.
*
* FT_VALIDATE_GPOS ::
* Validate GPOS table.
*
* FT_VALIDATE_GSUB ::
* Validate GSUB table.
*
* FT_VALIDATE_JSTF ::
* Validate JSTF table.
*
* FT_VALIDATE_MATH ::
* Validate MATH table.
*
* FT_VALIDATE_OT ::
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
*
*/
/**************************************************************************
*
* @enum:
* FT_VALIDATE_OTXXX
*
* @description:
* A list of bit-field constants used with @FT_OpenType_Validate to
* indicate which OpenType tables should be validated.
*
* @values:
* FT_VALIDATE_BASE ::
* Validate BASE table.
*
* FT_VALIDATE_GDEF ::
* Validate GDEF table.
*
* FT_VALIDATE_GPOS ::
* Validate GPOS table.
*
* FT_VALIDATE_GSUB ::
* Validate GSUB table.
*
* FT_VALIDATE_JSTF ::
* Validate JSTF table.
*
* FT_VALIDATE_MATH ::
* Validate MATH table.
*
* FT_VALIDATE_OT ::
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
*
*/
#define FT_VALIDATE_BASE 0x0100
#define FT_VALIDATE_GDEF 0x0200
#define FT_VALIDATE_GPOS 0x0400
@ -113,53 +113,54 @@ FT_BEGIN_HEADER
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH )
/**********************************************************************
*
* @function:
* FT_OpenType_Validate
*
* @description:
* Validate various OpenType tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_OTXXX for possible values.
*
* @output:
* BASE_table ::
* A pointer to the BASE table.
*
* GDEF_table ::
* A pointer to the GDEF table.
*
* GPOS_table ::
* A pointer to the GPOS table.
*
* GSUB_table ::
* A pointer to the GSUB table.
*
* JSTF_table ::
* A pointer to the JSTF table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with OpenType fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the five tables with
* @FT_OpenType_Free. A NULL value indicates that the table either
* doesn't exist in the font, or the application hasn't asked for
* validation.
*/
/**************************************************************************
*
* @function:
* FT_OpenType_Validate
*
* @description:
* Validate various OpenType tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_OTXXX for possible values.
*
* @output:
* BASE_table ::
* A pointer to the BASE table.
*
* GDEF_table ::
* A pointer to the GDEF table.
*
* GPOS_table ::
* A pointer to the GPOS table.
*
* GSUB_table ::
* A pointer to the GSUB table.
*
* JSTF_table ::
* A pointer to the JSTF table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with OpenType fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the five tables with
* @FT_OpenType_Free. A `NULL` value indicates that the table either
* doesn't exist in the font, or the application hasn't asked for
* validation.
*/
FT_EXPORT( FT_Error )
FT_OpenType_Validate( FT_Face face,
FT_UInt validation_flags,
@ -169,30 +170,32 @@ FT_BEGIN_HEADER
FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table );
/**********************************************************************
*
* @function:
* FT_OpenType_Free
*
* @description:
* Free the buffer allocated by OpenType validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_OpenType_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_OpenType_Validate only.
*/
/**************************************************************************
*
* @function:
* FT_OpenType_Free
*
* @description:
* Free the buffer allocated by OpenType validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_OpenType_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_OpenType_Validate only.
*/
FT_EXPORT( void )
FT_OpenType_Free( FT_Face face,
FT_Bytes table );
/* */

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftparams.h */
/* */
/* FreeType API for possible FT_Parameter tags (specification only). */
/* */
/* Copyright 2017-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftparams.h
*
* FreeType API for possible FT_Parameter tags (specification only).
*
* Copyright (C) 2017-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTPARAMS_H_
@ -51,16 +51,16 @@ FT_BEGIN_HEADER
*/
/***************************************************************************
/**************************************************************************
*
* @constant:
* @enum:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* family names in the `name' table (introduced in OpenType version
* 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction.
* family names in the 'name' table (introduced in OpenType version 1.4).
* Use this for backward compatibility with legacy systems that have a
* four-faces-per-family restriction.
*
* @since:
* 2.8
@ -75,14 +75,14 @@ FT_BEGIN_HEADER
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
/***************************************************************************
/**************************************************************************
*
* @constant:
* @enum:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* subfamily names in the `name' table (introduced in OpenType version
* subfamily names in the 'name' table (introduced in OpenType version
* 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction.
*
@ -99,9 +99,9 @@ FT_BEGIN_HEADER
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
/***************************************************************************
/**************************************************************************
*
* @constant:
* @enum:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
@ -115,14 +115,14 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @constant:
* @enum:
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding argument specifies the five LCD filter weights for a
* given face (if using @FT_LOAD_TARGET_LCD, for example), overriding
* the global default values or the values set up with
* given face (if using @FT_LOAD_TARGET_LCD, for example), overriding the
* global default values or the values set up with
* @FT_Library_SetLcdFilterWeights.
*
* @since:
@ -135,14 +135,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @constant:
* @enum:
* FT_PARAM_TAG_RANDOM_SEED
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding 32bit signed integer argument overrides the font
* driver's random seed value with a face-specific one; see
* @random-seed.
* driver's random seed value with a face-specific one; see @random-seed.
*
* @since:
* 2.8
@ -154,7 +153,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @constant:
* @enum:
* FT_PARAM_TAG_STEM_DARKENING
*
* @description:
@ -163,10 +162,10 @@ FT_BEGIN_HEADER
* darkening, overriding the global default values or the values set up
* with @FT_Property_Set (see @no-stem-darkening).
*
* This is a passive setting that only takes effect if the font driver
* or autohinter honors it, which the CFF, Type~1, and CID drivers
* always do, but the autohinter only in `light' hinting mode (as of
* version 2.9).
* This is a passive setting that only takes effect if the font driver or
* autohinter honors it, which the CFF, Type~1, and CID drivers always
* do, but the autohinter only in 'light' hinting mode (as of version
* 2.9).
*
* @since:
* 2.8
@ -176,19 +175,19 @@ FT_BEGIN_HEADER
FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* Deprecated, no effect.
*
* Previously: A constant used as the tag of an @FT_Parameter structure to
* indicate that unpatented methods only should be used by the TrueType
* bytecode interpreter for a typeface opened by @FT_Open_Face.
*
*/
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* Deprecated, no effect.
*
* Previously: A constant used as the tag of an @FT_Parameter structure
* to indicate that unpatented methods only should be used by the
* TrueType bytecode interpreter for a typeface opened by @FT_Open_Face.
*
*/
#define FT_PARAM_TAG_UNPATENTED_HINTING \
FT_MAKE_TAG( 'u', 'n', 'p', 'a' )

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftpfr.h */
/* */
/* FreeType API for accessing PFR-specific data (specification only). */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftpfr.h
*
* FreeType API for accessing PFR-specific data (specification only).
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTPFR_H_
@ -32,60 +32,61 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* pfr_fonts */
/* */
/* <Title> */
/* PFR Fonts */
/* */
/* <Abstract> */
/* PFR/TrueDoc specific API. */
/* */
/* <Description> */
/* This section contains the declaration of PFR-specific functions. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* pfr_fonts
*
* @title:
* PFR Fonts
*
* @abstract:
* PFR/TrueDoc-specific API.
*
* @description:
* This section contains the declaration of PFR-specific functions.
*
*/
/**********************************************************************
*
* @function:
* FT_Get_PFR_Metrics
*
* @description:
* Return the outline and metrics resolutions of a given PFR face.
*
* @input:
* face :: Handle to the input face. It can be a non-PFR face.
*
* @output:
* aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM'
* for non-PFR fonts. Optional (parameter can be NULL).
*
* ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution'
* for non-PFR fonts. Optional (parameter can be NULL).
*
* ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed
* in metrics units to device subpixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter
* can be NULL).
*
* ametrics_y_scale ::
* Same as `ametrics_x_scale' but for the vertical direction.
* optional (parameter can be NULL).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If the input face is not a PFR, this function will return an error.
* However, in all cases, it will return valid values.
*/
/**************************************************************************
*
* @function:
* FT_Get_PFR_Metrics
*
* @description:
* Return the outline and metrics resolutions of a given PFR face.
*
* @input:
* face ::
* Handle to the input face. It can be a non-PFR face.
*
* @output:
* aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM` for
* non-PFR fonts. Optional (parameter can be `NULL`).
*
* ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution` for
* non-PFR fonts. Optional (parameter can be `NULL`).
*
* ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed in
* metrics units to device subpixels. This is equivalent to
* `face->size->x_scale`, but for metrics only. Optional (parameter
* can be `NULL`).
*
* ametrics_y_scale ::
* Same as `ametrics_x_scale` but for the vertical direction.
* optional (parameter can be `NULL`).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If the input face is not a PFR, this function will return an error.
* However, in all cases, it will return valid values.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Metrics( FT_Face face,
FT_UInt *aoutline_resolution,
@ -94,37 +95,41 @@ FT_BEGIN_HEADER
FT_Fixed *ametrics_y_scale );
/**********************************************************************
*
* @function:
* FT_Get_PFR_Kerning
*
* @description:
* Return the kerning pair corresponding to two glyphs in a PFR face.
* The distance is expressed in metrics units, unlike the result of
* @FT_Get_Kerning.
*
* @input:
* face :: A handle to the input face.
*
* left :: Index of the left glyph.
*
* right :: Index of the right glyph.
*
* @output:
* avector :: A kerning vector.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function always return distances in original PFR metrics
* units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
* mode, which always returns distances converted to outline units.
*
* You can use the value of the `x_scale' and `y_scale' parameters
* returned by @FT_Get_PFR_Metrics to scale these to device subpixels.
*/
/**************************************************************************
*
* @function:
* FT_Get_PFR_Kerning
*
* @description:
* Return the kerning pair corresponding to two glyphs in a PFR face.
* The distance is expressed in metrics units, unlike the result of
* @FT_Get_Kerning.
*
* @input:
* face ::
* A handle to the input face.
*
* left ::
* Index of the left glyph.
*
* right ::
* Index of the right glyph.
*
* @output:
* avector ::
* A kerning vector.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function always return distances in original PFR metrics units.
* This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED mode,
* which always returns distances converted to outline units.
*
* You can use the value of the `x_scale` and `y_scale` parameters
* returned by @FT_Get_PFR_Metrics to scale these to device subpixels.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Kerning( FT_Face face,
FT_UInt left,
@ -132,30 +137,33 @@ FT_BEGIN_HEADER
FT_Vector *avector );
/**********************************************************************
*
* @function:
* FT_Get_PFR_Advance
*
* @description:
* Return a given glyph advance, expressed in original metrics units,
* from a PFR font.
*
* @input:
* face :: A handle to the input face.
*
* gindex :: The glyph index.
*
* @output:
* aadvance :: The glyph advance in metrics units.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
* to convert the advance to device subpixels (i.e., 1/64th of pixels).
*/
/**************************************************************************
*
* @function:
* FT_Get_PFR_Advance
*
* @description:
* Return a given glyph advance, expressed in original metrics units,
* from a PFR font.
*
* @input:
* face ::
* A handle to the input face.
*
* gindex ::
* The glyph index.
*
* @output:
* aadvance ::
* The glyph advance in metrics units.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You can use the `x_scale` or `y_scale` results of @FT_Get_PFR_Metrics
* to convert the advance to device subpixels (i.e., 1/64th of pixels).
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face,
FT_UInt gindex,

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftrender.h */
/* */
/* FreeType renderer modules public interface (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftrender.h
*
* FreeType renderer modules public interface (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTRENDER_H_
@ -28,12 +28,12 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* module_management */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* module_management
*
*/
/* create a new glyph object */
@ -116,32 +116,38 @@ FT_BEGIN_HEADER
#define FTRenderer_setMode FT_Renderer_SetModeFunc
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Renderer_Class */
/* */
/* <Description> */
/* The renderer module class descriptor. */
/* */
/* <Fields> */
/* root :: The root @FT_Module_Class fields. */
/* */
/* glyph_format :: The glyph image format this renderer handles. */
/* */
/* render_glyph :: A method used to render the image that is in a */
/* given glyph slot into a bitmap. */
/* */
/* transform_glyph :: A method used to transform the image that is in */
/* a given glyph slot. */
/* */
/* get_glyph_cbox :: A method used to access the glyph's cbox. */
/* */
/* set_mode :: A method used to pass additional parameters. */
/* */
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
/* This is a pointer to its raster's class. */
/* */
/**************************************************************************
*
* @struct:
* FT_Renderer_Class
*
* @description:
* The renderer module class descriptor.
*
* @fields:
* root ::
* The root @FT_Module_Class fields.
*
* glyph_format ::
* The glyph image format this renderer handles.
*
* render_glyph ::
* A method used to render the image that is in a given glyph slot into
* a bitmap.
*
* transform_glyph ::
* A method used to transform the image that is in a given glyph slot.
*
* get_glyph_cbox ::
* A method used to access the glyph's cbox.
*
* set_mode ::
* A method used to pass additional parameters.
*
* raster_class ::
* For @FT_GLYPH_FORMAT_OUTLINE renderers only. This is a pointer to
* its raster's class.
*/
typedef struct FT_Renderer_Class_
{
FT_Module_Class root;
@ -158,64 +164,70 @@ FT_BEGIN_HEADER
} FT_Renderer_Class;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Renderer */
/* */
/* <Description> */
/* Retrieve the current renderer for a given glyph format. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* format :: The glyph format. */
/* */
/* <Return> */
/* A renderer handle. 0~if none found. */
/* */
/* <Note> */
/* An error will be returned if a module already exists by that name, */
/* or if the module requires a version of FreeType that is too great. */
/* */
/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
/* renderer by its name, use @FT_Get_Module. */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Renderer
*
* @description:
* Retrieve the current renderer for a given glyph format.
*
* @input:
* library ::
* A handle to the library object.
*
* format ::
* The glyph format.
*
* @return:
* A renderer handle. 0~if none found.
*
* @note:
* An error will be returned if a module already exists by that name, or
* if the module requires a version of FreeType that is too great.
*
* To add a new renderer, simply use @FT_Add_Module. To retrieve a
* renderer by its name, use @FT_Get_Module.
*/
FT_EXPORT( FT_Renderer )
FT_Get_Renderer( FT_Library library,
FT_Glyph_Format format );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Renderer */
/* */
/* <Description> */
/* Set the current renderer to use, and set additional mode. */
/* */
/* <InOut> */
/* library :: A handle to the library object. */
/* */
/* <Input> */
/* renderer :: A handle to the renderer object. */
/* */
/* num_params :: The number of additional parameters. */
/* */
/* parameters :: Additional parameters. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* In case of success, the renderer will be used to convert glyph */
/* images in the renderer's known format into bitmaps. */
/* */
/* This doesn't change the current renderer for other formats. */
/* */
/* Currently, no FreeType renderer module uses `parameters'; you */
/* should thus always pass NULL as the value. */
/* */
/**************************************************************************
*
* @function:
* FT_Set_Renderer
*
* @description:
* Set the current renderer to use, and set additional mode.
*
* @inout:
* library ::
* A handle to the library object.
*
* @input:
* renderer ::
* A handle to the renderer object.
*
* num_params ::
* The number of additional parameters.
*
* parameters ::
* Additional parameters.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* In case of success, the renderer will be used to convert glyph images
* in the renderer's known format into bitmaps.
*
* This doesn't change the current renderer for other formats.
*
* Currently, no FreeType renderer module uses `parameters`; you should
* thus always pass `NULL` as the value.
*/
FT_EXPORT( FT_Error )
FT_Set_Renderer( FT_Library library,
FT_Renderer renderer,

View File

@ -1,28 +1,28 @@
/***************************************************************************/
/* */
/* ftsizes.h */
/* */
/* FreeType size objects management (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftsizes.h
*
* FreeType size objects management (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* Typical application would normally not need to use these functions. */
/* However, they have been placed in a public API for the rare cases */
/* where they are needed. */
/* */
/*************************************************************************/
/**************************************************************************
*
* Typical application would normally not need to use these functions.
* However, they have been placed in a public API for the rare cases where
* they are needed.
*
*/
#ifndef FTSIZES_H_
@ -42,109 +42,110 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* sizes_management */
/* */
/* <Title> */
/* Size Management */
/* */
/* <Abstract> */
/* Managing multiple sizes per face. */
/* */
/* <Description> */
/* When creating a new face object (e.g., with @FT_New_Face), an */
/* @FT_Size object is automatically created and used to store all */
/* pixel-size dependent information, available in the `face->size' */
/* field. */
/* */
/* It is however possible to create more sizes for a given face, */
/* mostly in order to manage several character pixel sizes of the */
/* same font family and style. See @FT_New_Size and @FT_Done_Size. */
/* */
/* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
/* modify the contents of the current `active' size; you thus need */
/* to use @FT_Activate_Size to change it. */
/* */
/* 99% of applications won't need the functions provided here, */
/* especially if they use the caching sub-system, so be cautious */
/* when using these. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* sizes_management
*
* @title:
* Size Management
*
* @abstract:
* Managing multiple sizes per face.
*
* @description:
* When creating a new face object (e.g., with @FT_New_Face), an @FT_Size
* object is automatically created and used to store all pixel-size
* dependent information, available in the `face->size` field.
*
* It is however possible to create more sizes for a given face, mostly
* in order to manage several character pixel sizes of the same font
* family and style. See @FT_New_Size and @FT_Done_Size.
*
* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only modify the
* contents of the current 'active' size; you thus need to use
* @FT_Activate_Size to change it.
*
* 99% of applications won't need the functions provided here, especially
* if they use the caching sub-system, so be cautious when using these.
*
*/
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Size */
/* */
/* <Description> */
/* Create a new size object from a given face object. */
/* */
/* <Input> */
/* face :: A handle to a parent face object. */
/* */
/* <Output> */
/* asize :: A handle to a new size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* You need to call @FT_Activate_Size in order to select the new size */
/* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
/* @FT_Load_Glyph, @FT_Load_Char, etc. */
/* */
/**************************************************************************
*
* @function:
* FT_New_Size
*
* @description:
* Create a new size object from a given face object.
*
* @input:
* face ::
* A handle to a parent face object.
*
* @output:
* asize ::
* A handle to a new size object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You need to call @FT_Activate_Size in order to select the new size for
* upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,
* @FT_Load_Glyph, @FT_Load_Char, etc.
*/
FT_EXPORT( FT_Error )
FT_New_Size( FT_Face face,
FT_Size* size );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Size */
/* */
/* <Description> */
/* Discard a given size object. Note that @FT_Done_Face */
/* automatically discards all size objects allocated with */
/* @FT_New_Size. */
/* */
/* <Input> */
/* size :: A handle to a target size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/**************************************************************************
*
* @function:
* FT_Done_Size
*
* @description:
* Discard a given size object. Note that @FT_Done_Face automatically
* discards all size objects allocated with @FT_New_Size.
*
* @input:
* size ::
* A handle to a target size object.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT( FT_Error )
FT_Done_Size( FT_Size size );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Activate_Size */
/* */
/* <Description> */
/* Even though it is possible to create several size objects for a */
/* given face (see @FT_New_Size for details), functions like */
/* @FT_Load_Glyph or @FT_Load_Char only use the one that has been */
/* activated last to determine the `current character pixel size'. */
/* */
/* This function can be used to `activate' a previously created size */
/* object. */
/* */
/* <Input> */
/* size :: A handle to a target size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* If `face' is the size's parent face object, this function changes */
/* the value of `face->size' to the input size handle. */
/* */
/**************************************************************************
*
* @function:
* FT_Activate_Size
*
* @description:
* Even though it is possible to create several size objects for a given
* face (see @FT_New_Size for details), functions like @FT_Load_Glyph or
* @FT_Load_Char only use the one that has been activated last to
* determine the 'current character pixel size'.
*
* This function can be used to 'activate' a previously created size
* object.
*
* @input:
* size ::
* A handle to a target size object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If `face` is the size's parent face object, this function changes the
* value of `face->size` to the input size handle.
*/
FT_EXPORT( FT_Error )
FT_Activate_Size( FT_Size size );

View File

@ -1,22 +1,22 @@
/***************************************************************************/
/* */
/* ftsnames.h */
/* */
/* Simple interface to access SFNT `name' tables (which are used */
/* to hold font names, copyright info, notices, etc.) (specification). */
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftsnames.h
*
* Simple interface to access SFNT 'name' tables (which are used
* to hold font names, copyright info, notices, etc.) (specification).
*
* This is _not_ used to retrieve glyph names!
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTSNAMES_H_
@ -37,72 +37,74 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* sfnt_names */
/* */
/* <Title> */
/* SFNT Names */
/* */
/* <Abstract> */
/* Access the names embedded in TrueType and OpenType files. */
/* */
/* <Description> */
/* The TrueType and OpenType specifications allow the inclusion of */
/* a special names table (`name') in font files. This table contains */
/* textual (and internationalized) information regarding the font, */
/* like family name, copyright, version, etc. */
/* */
/* The definitions below are used to access them if available. */
/* */
/* Note that this has nothing to do with glyph names! */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* sfnt_names
*
* @title:
* SFNT Names
*
* @abstract:
* Access the names embedded in TrueType and OpenType files.
*
* @description:
* The TrueType and OpenType specifications allow the inclusion of a
* special names table ('name') in font files. This table contains
* textual (and internationalized) information regarding the font, like
* family name, copyright, version, etc.
*
* The definitions below are used to access them if available.
*
* Note that this has nothing to do with glyph names!
*
*/
/*************************************************************************/
/* */
/* <Struct> */
/* FT_SfntName */
/* */
/* <Description> */
/* A structure used to model an SFNT `name' table entry. */
/* */
/* <Fields> */
/* platform_id :: The platform ID for `string'. */
/* See @TT_PLATFORM_XXX for possible values. */
/* */
/* encoding_id :: The encoding ID for `string'. */
/* See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
/* @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX */
/* for possible values. */
/* */
/* language_id :: The language ID for `string'. */
/* See @TT_MAC_LANGID_XXX and @TT_MS_LANGID_XXX for */
/* possible values. */
/* */
/* Registered OpenType values for `language_id' are */
/* always smaller than 0x8000; values equal or larger */
/* than 0x8000 usually indicate a language tag string */
/* (introduced in OpenType version 1.6). Use function */
/* @FT_Get_Sfnt_LangTag with `language_id' as its */
/* argument to retrieve the associated language tag. */
/* */
/* name_id :: An identifier for `string'. */
/* See @TT_NAME_ID_XXX for possible values. */
/* */
/* string :: The `name' string. Note that its format differs */
/* depending on the (platform,encoding) pair, being */
/* either a string of bytes (without a terminating */
/* NULL byte) or containing UTF-16BE entities. */
/* */
/* string_len :: The length of `string' in bytes. */
/* */
/* <Note> */
/* Please refer to the TrueType or OpenType specification for more */
/* details. */
/* */
/**************************************************************************
*
* @struct:
* FT_SfntName
*
* @description:
* A structure used to model an SFNT 'name' table entry.
*
* @fields:
* platform_id ::
* The platform ID for `string`. See @TT_PLATFORM_XXX for possible
* values.
*
* encoding_id ::
* The encoding ID for `string`. See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,
* @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX for possible
* values.
*
* language_id ::
* The language ID for `string`. See @TT_MAC_LANGID_XXX and
* @TT_MS_LANGID_XXX for possible values.
*
* Registered OpenType values for `language_id` are always smaller than
* 0x8000; values equal or larger than 0x8000 usually indicate a
* language tag string (introduced in OpenType version 1.6). Use
* function @FT_Get_Sfnt_LangTag with `language_id` as its argument to
* retrieve the associated language tag.
*
* name_id ::
* An identifier for `string`. See @TT_NAME_ID_XXX for possible
* values.
*
* string ::
* The 'name' string. Note that its format differs depending on the
* (platform,encoding) pair, being either a string of bytes (without a
* terminating `NULL` byte) or containing UTF-16BE entities.
*
* string_len ::
* The length of `string` in bytes.
*
* @note:
* Please refer to the TrueType or OpenType specification for more
* details.
*/
typedef struct FT_SfntName_
{
FT_UShort platform_id;
@ -116,83 +118,95 @@ FT_BEGIN_HEADER
} FT_SfntName;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_Name_Count */
/* */
/* <Description> */
/* Retrieve the number of name strings in the SFNT `name' table. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Return> */
/* The number of strings in the `name' table. */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Sfnt_Name_Count
*
* @description:
* Retrieve the number of name strings in the SFNT 'name' table.
*
* @input:
* face ::
* A handle to the source face.
*
* @return:
* The number of strings in the 'name' table.
*
* @note:
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*/
FT_EXPORT( FT_UInt )
FT_Get_Sfnt_Name_Count( FT_Face face );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_Name */
/* */
/* <Description> */
/* Retrieve a string of the SFNT `name' table for a given index. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* idx :: The index of the `name' string. */
/* */
/* <Output> */
/* aname :: The indexed @FT_SfntName structure. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The `string' array returned in the `aname' structure is not */
/* null-terminated. Note that you don't have to deallocate `string' */
/* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
/* */
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
/* `name' table entries, then do a loop until you get the right */
/* platform, encoding, and name ID. */
/* */
/* `name' table format~1 entries can use language tags also, see */
/* @FT_Get_Sfnt_LangTag. */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Sfnt_Name
*
* @description:
* Retrieve a string of the SFNT 'name' table for a given index.
*
* @input:
* face ::
* A handle to the source face.
*
* idx ::
* The index of the 'name' string.
*
* @output:
* aname ::
* The indexed @FT_SfntName structure.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The `string` array returned in the `aname` structure is not
* null-terminated. Note that you don't have to deallocate `string` by
* yourself; FreeType takes care of it if you call @FT_Done_Face.
*
* Use @FT_Get_Sfnt_Name_Count to get the total number of available
* 'name' table entries, then do a loop until you get the right platform,
* encoding, and name ID.
*
* 'name' table format~1 entries can use language tags also, see
* @FT_Get_Sfnt_LangTag.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*/
FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx,
FT_SfntName *aname );
/*************************************************************************/
/* */
/* <Struct> */
/* FT_SfntLangTag */
/* */
/* <Description> */
/* A structure to model a language tag entry from an SFNT `name' */
/* table. */
/* */
/* <Fields> */
/* string :: The language tag string, encoded in UTF-16BE */
/* (without trailing NULL bytes). */
/* */
/* string_len :: The length of `string' in *bytes*. */
/* */
/* <Note> */
/* Please refer to the TrueType or OpenType specification for more */
/* details. */
/* */
/* <Since> */
/* 2.8 */
/* */
/**************************************************************************
*
* @struct:
* FT_SfntLangTag
*
* @description:
* A structure to model a language tag entry from an SFNT 'name' table.
*
* @fields:
* string ::
* The language tag string, encoded in UTF-16BE (without trailing
* `NULL` bytes).
*
* string_len ::
* The length of `string` in **bytes**.
*
* @note:
* Please refer to the TrueType or OpenType specification for more
* details.
*
* @since:
* 2.8
*/
typedef struct FT_SfntLangTag_
{
FT_Byte* string; /* this string is *not* null-terminated! */
@ -201,41 +215,47 @@ FT_BEGIN_HEADER
} FT_SfntLangTag;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_LangTag */
/* */
/* <Description> */
/* Retrieve the language tag associated with a language ID of an SFNT */
/* `name' table entry. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* langID :: The language ID, as returned by @FT_Get_Sfnt_Name. */
/* This is always a value larger than 0x8000. */
/* */
/* <Output> */
/* alangTag :: The language tag associated with the `name' table */
/* entry's language ID. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The `string' array returned in the `alangTag' structure is not */
/* null-terminated. Note that you don't have to deallocate `string' */
/* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
/* */
/* Only `name' table format~1 supports language tags. For format~0 */
/* tables, this function always returns FT_Err_Invalid_Table. For */
/* invalid format~1 language ID values, FT_Err_Invalid_Argument is */
/* returned. */
/* */
/* <Since> */
/* 2.8 */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Sfnt_LangTag
*
* @description:
* Retrieve the language tag associated with a language ID of an SFNT
* 'name' table entry.
*
* @input:
* face ::
* A handle to the source face.
*
* langID ::
* The language ID, as returned by @FT_Get_Sfnt_Name. This is always a
* value larger than 0x8000.
*
* @output:
* alangTag ::
* The language tag associated with the 'name' table entry's language
* ID.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The `string` array returned in the `alangTag` structure is not
* null-terminated. Note that you don't have to deallocate `string` by
* yourself; FreeType takes care of it if you call @FT_Done_Face.
*
* Only 'name' table format~1 supports language tags. For format~0
* tables, this function always returns FT_Err_Invalid_Table. For
* invalid format~1 language ID values, FT_Err_Invalid_Argument is
* returned.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*
* @since:
* 2.8
*/
FT_EXPORT( FT_Error )
FT_Get_Sfnt_LangTag( FT_Face face,
FT_UInt langID,

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftstroke.h */
/* */
/* FreeType path stroker (specification). */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftstroke.h
*
* FreeType path stroker (specification).
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTSTROKE_H_
@ -27,116 +27,113 @@
FT_BEGIN_HEADER
/************************************************************************
*
* @section:
* glyph_stroker
*
* @title:
* Glyph Stroker
*
* @abstract:
* Generating bordered and stroked glyphs.
*
* @description:
* This component generates stroked outlines of a given vectorial
* glyph. It also allows you to retrieve the `outside' and/or the
* `inside' borders of the stroke.
*
* This can be useful to generate `bordered' glyph, i.e., glyphs
* displayed with a coloured (and anti-aliased) border around their
* shape.
*
* @order:
* FT_Stroker
*
* FT_Stroker_LineJoin
* FT_Stroker_LineCap
* FT_StrokerBorder
*
* FT_Outline_GetInsideBorder
* FT_Outline_GetOutsideBorder
*
* FT_Glyph_Stroke
* FT_Glyph_StrokeBorder
*
* FT_Stroker_New
* FT_Stroker_Set
* FT_Stroker_Rewind
* FT_Stroker_ParseOutline
* FT_Stroker_Done
*
* FT_Stroker_BeginSubPath
* FT_Stroker_EndSubPath
*
* FT_Stroker_LineTo
* FT_Stroker_ConicTo
* FT_Stroker_CubicTo
*
* FT_Stroker_GetBorderCounts
* FT_Stroker_ExportBorder
* FT_Stroker_GetCounts
* FT_Stroker_Export
*
*/
/**************************************************************************
*
* @section:
* glyph_stroker
*
* @title:
* Glyph Stroker
*
* @abstract:
* Generating bordered and stroked glyphs.
*
* @description:
* This component generates stroked outlines of a given vectorial glyph.
* It also allows you to retrieve the 'outside' and/or the 'inside'
* borders of the stroke.
*
* This can be useful to generate 'bordered' glyph, i.e., glyphs
* displayed with a coloured (and anti-aliased) border around their
* shape.
*
* @order:
* FT_Stroker
*
* FT_Stroker_LineJoin
* FT_Stroker_LineCap
* FT_StrokerBorder
*
* FT_Outline_GetInsideBorder
* FT_Outline_GetOutsideBorder
*
* FT_Glyph_Stroke
* FT_Glyph_StrokeBorder
*
* FT_Stroker_New
* FT_Stroker_Set
* FT_Stroker_Rewind
* FT_Stroker_ParseOutline
* FT_Stroker_Done
*
* FT_Stroker_BeginSubPath
* FT_Stroker_EndSubPath
*
* FT_Stroker_LineTo
* FT_Stroker_ConicTo
* FT_Stroker_CubicTo
*
* FT_Stroker_GetBorderCounts
* FT_Stroker_ExportBorder
* FT_Stroker_GetCounts
* FT_Stroker_Export
*
*/
/**************************************************************
*
* @type:
* FT_Stroker
*
* @description:
* Opaque handle to a path stroker object.
*/
/**************************************************************************
*
* @type:
* FT_Stroker
*
* @description:
* Opaque handle to a path stroker object.
*/
typedef struct FT_StrokerRec_* FT_Stroker;
/**************************************************************
/**************************************************************************
*
* @enum:
* FT_Stroker_LineJoin
*
* @description:
* These values determine how two joining lines are rendered
* in a stroker.
* These values determine how two joining lines are rendered in a
* stroker.
*
* @values:
* FT_STROKER_LINEJOIN_ROUND ::
* Used to render rounded line joins. Circular arcs are used
* to join two lines smoothly.
* Used to render rounded line joins. Circular arcs are used to join
* two lines smoothly.
*
* FT_STROKER_LINEJOIN_BEVEL ::
* Used to render beveled line joins. The outer corner of
* the joined lines is filled by enclosing the triangular
* region of the corner with a straight line between the
* outer corners of each stroke.
* Used to render beveled line joins. The outer corner of the joined
* lines is filled by enclosing the triangular region of the corner
* with a straight line between the outer corners of each stroke.
*
* FT_STROKER_LINEJOIN_MITER_FIXED ::
* Used to render mitered line joins, with fixed bevels if the
* miter limit is exceeded. The outer edges of the strokes
* for the two segments are extended until they meet at an
* angle. If the segments meet at too sharp an angle (such
* that the miter would extend from the intersection of the
* segments a distance greater than the product of the miter
* limit value and the border radius), then a bevel join (see
* above) is used instead. This prevents long spikes being
* created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter
* line join as used in PostScript and PDF.
* Used to render mitered line joins, with fixed bevels if the miter
* limit is exceeded. The outer edges of the strokes for the two
* segments are extended until they meet at an angle. If the segments
* meet at too sharp an angle (such that the miter would extend from
* the intersection of the segments a distance greater than the product
* of the miter limit value and the border radius), then a bevel join
* (see above) is used instead. This prevents long spikes being
* created. `FT_STROKER_LINEJOIN_MITER_FIXED` generates a miter line
* join as used in PostScript and PDF.
*
* FT_STROKER_LINEJOIN_MITER_VARIABLE ::
* FT_STROKER_LINEJOIN_MITER ::
* Used to render mitered line joins, with variable bevels if
* the miter limit is exceeded. The intersection of the
* strokes is clipped at a line perpendicular to the bisector
* of the angle between the strokes, at the distance from the
* intersection of the segments equal to the product of the
* miter limit value and the border radius. This prevents
* long spikes being created.
* FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
* join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias
* for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
* backward compatibility.
* Used to render mitered line joins, with variable bevels if the miter
* limit is exceeded. The intersection of the strokes is clipped at a
* line perpendicular to the bisector of the angle between the strokes,
* at the distance from the intersection of the segments equal to the
* product of the miter limit value and the border radius. This
* prevents long spikes being created.
* `FT_STROKER_LINEJOIN_MITER_VARIABLE` generates a mitered line join
* as used in XPS. `FT_STROKER_LINEJOIN_MITER` is an alias for
* `FT_STROKER_LINEJOIN_MITER_VARIABLE`, retained for backward
* compatibility.
*/
typedef enum FT_Stroker_LineJoin_
{
@ -149,27 +146,25 @@ FT_BEGIN_HEADER
} FT_Stroker_LineJoin;
/**************************************************************
/**************************************************************************
*
* @enum:
* FT_Stroker_LineCap
*
* @description:
* These values determine how the end of opened sub-paths are
* rendered in a stroke.
* These values determine how the end of opened sub-paths are rendered in
* a stroke.
*
* @values:
* FT_STROKER_LINECAP_BUTT ::
* The end of lines is rendered as a full stop on the last
* point itself.
* The end of lines is rendered as a full stop on the last point
* itself.
*
* FT_STROKER_LINECAP_ROUND ::
* The end of lines is rendered as a half-circle around the
* last point.
* The end of lines is rendered as a half-circle around the last point.
*
* FT_STROKER_LINECAP_SQUARE ::
* The end of lines is rendered as a square around the
* last point.
* The end of lines is rendered as a square around the last point.
*/
typedef enum FT_Stroker_LineCap_
{
@ -180,14 +175,14 @@ FT_BEGIN_HEADER
} FT_Stroker_LineCap;
/**************************************************************
/**************************************************************************
*
* @enum:
* FT_StrokerBorder
*
* @description:
* These values are used to select a given stroke border
* in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
* These values are used to select a given stroke border in
* @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
*
* @values:
* FT_STROKER_BORDER_LEFT ::
@ -197,9 +192,9 @@ FT_BEGIN_HEADER
* Select the right border, relative to the drawing direction.
*
* @note:
* Applications are generally interested in the `inside' and `outside'
* Applications are generally interested in the 'inside' and 'outside'
* borders. However, there is no direct mapping between these and the
* `left' and `right' ones, since this really depends on the glyph's
* 'left' and 'right' ones, since this really depends on the glyph's
* drawing orientation, which varies between font formats.
*
* You can however use @FT_Outline_GetInsideBorder and
@ -213,14 +208,14 @@ FT_BEGIN_HEADER
} FT_StrokerBorder;
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Outline_GetInsideBorder
*
* @description:
* Retrieve the @FT_StrokerBorder value corresponding to the
* `inside' borders of a given outline.
* Retrieve the @FT_StrokerBorder value corresponding to the 'inside'
* borders of a given outline.
*
* @input:
* outline ::
@ -234,14 +229,14 @@ FT_BEGIN_HEADER
FT_Outline_GetInsideBorder( FT_Outline* outline );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Outline_GetOutsideBorder
*
* @description:
* Retrieve the @FT_StrokerBorder value corresponding to the
* `outside' borders of a given outline.
* Retrieve the @FT_StrokerBorder value corresponding to the 'outside'
* borders of a given outline.
*
* @input:
* outline ::
@ -255,7 +250,7 @@ FT_BEGIN_HEADER
FT_Outline_GetOutsideBorder( FT_Outline* outline );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_New
@ -269,7 +264,7 @@ FT_BEGIN_HEADER
*
* @output:
* astroker ::
* A new stroker object handle. NULL in case of error.
* A new stroker object handle. `NULL` in case of error.
*
* @return:
* FreeType error code. 0~means success.
@ -279,7 +274,7 @@ FT_BEGIN_HEADER
FT_Stroker *astroker );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_Set
@ -301,13 +296,12 @@ FT_BEGIN_HEADER
* The line join style.
*
* miter_limit ::
* The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and
* FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,
* expressed as 16.16 fixed-point value.
* The miter limit for the `FT_STROKER_LINEJOIN_MITER_FIXED` and
* `FT_STROKER_LINEJOIN_MITER_VARIABLE` line join styles, expressed as
* 16.16 fixed-point value.
*
* @note:
* The radius is expressed in the same units as the outline
* coordinates.
* The radius is expressed in the same units as the outline coordinates.
*
* This function calls @FT_Stroker_Rewind automatically.
*/
@ -319,16 +313,15 @@ FT_BEGIN_HEADER
FT_Fixed miter_limit );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_Rewind
*
* @description:
* Reset a stroker object without changing its attributes.
* You should call this function before beginning a new
* series of calls to @FT_Stroker_BeginSubPath or
* @FT_Stroker_EndSubPath.
* Reset a stroker object without changing its attributes. You should
* call this function before beginning a new series of calls to
* @FT_Stroker_BeginSubPath or @FT_Stroker_EndSubPath.
*
* @input:
* stroker ::
@ -338,15 +331,15 @@ FT_BEGIN_HEADER
FT_Stroker_Rewind( FT_Stroker stroker );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_ParseOutline
*
* @description:
* A convenience function used to parse a whole outline with
* the stroker. The resulting outline(s) can be retrieved
* later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
* A convenience function used to parse a whole outline with the stroker.
* The resulting outline(s) can be retrieved later by functions like
* @FT_Stroker_GetCounts and @FT_Stroker_Export.
*
* @input:
* stroker ::
@ -356,18 +349,18 @@ FT_BEGIN_HEADER
* The source outline.
*
* opened ::
* A boolean. If~1, the outline is treated as an open path instead
* of a closed one.
* A boolean. If~1, the outline is treated as an open path instead of
* a closed one.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If `opened' is~0 (the default), the outline is treated as a closed
* path, and the stroker generates two distinct `border' outlines.
* If `opened` is~0 (the default), the outline is treated as a closed
* path, and the stroker generates two distinct 'border' outlines.
*
* If `opened' is~1, the outline is processed as an open path, and the
* stroker generates a single `stroke' outline.
* If `opened` is~1, the outline is processed as an open path, and the
* stroker generates a single 'stroke' outline.
*
* This function calls @FT_Stroker_Rewind automatically.
*/
@ -377,7 +370,7 @@ FT_BEGIN_HEADER
FT_Bool opened );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_BeginSubPath
@ -399,8 +392,8 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
* This function is useful when you need to stroke a path that is
* not stored as an @FT_Outline object.
* This function is useful when you need to stroke a path that is not
* stored as an @FT_Outline object.
*/
FT_EXPORT( FT_Error )
FT_Stroker_BeginSubPath( FT_Stroker stroker,
@ -408,7 +401,7 @@ FT_BEGIN_HEADER
FT_Bool open );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_EndSubPath
@ -424,22 +417,22 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
* You should call this function after @FT_Stroker_BeginSubPath.
* If the subpath was not `opened', this function `draws' a
* single line segment to the start position when needed.
* You should call this function after @FT_Stroker_BeginSubPath. If the
* subpath was not 'opened', this function 'draws' a single line segment
* to the start position when needed.
*/
FT_EXPORT( FT_Error )
FT_Stroker_EndSubPath( FT_Stroker stroker );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_LineTo
*
* @description:
* `Draw' a single line segment in the stroker's current sub-path,
* from the last position.
* 'Draw' a single line segment in the stroker's current sub-path, from
* the last position.
*
* @input:
* stroker ::
@ -460,13 +453,13 @@ FT_BEGIN_HEADER
FT_Vector* to );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_ConicTo
*
* @description:
* `Draw' a single quadratic Bezier in the stroker's current sub-path,
* 'Draw' a single quadratic Bezier in the stroker's current sub-path,
* from the last position.
*
* @input:
@ -492,14 +485,14 @@ FT_BEGIN_HEADER
FT_Vector* to );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_CubicTo
*
* @description:
* `Draw' a single cubic Bezier in the stroker's current sub-path,
* from the last position.
* 'Draw' a single cubic Bezier in the stroker's current sub-path, from
* the last position.
*
* @input:
* stroker ::
@ -528,16 +521,16 @@ FT_BEGIN_HEADER
FT_Vector* to );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_GetBorderCounts
*
* @description:
* Call this function once you have finished parsing your paths
* with the stroker. It returns the number of points and
* contours necessary to export one of the `border' or `stroke'
* outlines generated by the stroker.
* Call this function once you have finished parsing your paths with the
* stroker. It returns the number of points and contours necessary to
* export one of the 'border' or 'stroke' outlines generated by the
* stroker.
*
* @input:
* stroker ::
@ -557,15 +550,15 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
* When an outline, or a sub-path, is `closed', the stroker generates
* two independent `border' outlines, named `left' and `right'.
* When an outline, or a sub-path, is 'closed', the stroker generates two
* independent 'border' outlines, named 'left' and 'right'.
*
* When the outline, or a sub-path, is `opened', the stroker merges
* the `border' outlines with caps. The `left' border receives all
* points, while the `right' border becomes empty.
* When the outline, or a sub-path, is 'opened', the stroker merges the
* 'border' outlines with caps. The 'left' border receives all points,
* while the 'right' border becomes empty.
*
* Use the function @FT_Stroker_GetCounts instead if you want to
* retrieve the counts associated to both borders.
* Use the function @FT_Stroker_GetCounts instead if you want to retrieve
* the counts associated to both borders.
*/
FT_EXPORT( FT_Error )
FT_Stroker_GetBorderCounts( FT_Stroker stroker,
@ -574,19 +567,17 @@ FT_BEGIN_HEADER
FT_UInt *anum_contours );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_ExportBorder
*
* @description:
* Call this function after @FT_Stroker_GetBorderCounts to
* export the corresponding border to your own @FT_Outline
* structure.
* Call this function after @FT_Stroker_GetBorderCounts to export the
* corresponding border to your own @FT_Outline structure.
*
* Note that this function appends the border points and
* contours to your outline, but does not try to resize its
* arrays.
* Note that this function appends the border points and contours to your
* outline, but does not try to resize its arrays.
*
* @input:
* stroker ::
@ -599,19 +590,19 @@ FT_BEGIN_HEADER
* The target outline handle.
*
* @note:
* Always call this function after @FT_Stroker_GetBorderCounts to
* get sure that there is enough room in your @FT_Outline object to
* receive all new data.
* Always call this function after @FT_Stroker_GetBorderCounts to get
* sure that there is enough room in your @FT_Outline object to receive
* all new data.
*
* When an outline, or a sub-path, is `closed', the stroker generates
* two independent `border' outlines, named `left' and `right'.
* When an outline, or a sub-path, is 'closed', the stroker generates two
* independent 'border' outlines, named 'left' and 'right'.
*
* When the outline, or a sub-path, is `opened', the stroker merges
* the `border' outlines with caps. The `left' border receives all
* points, while the `right' border becomes empty.
* When the outline, or a sub-path, is 'opened', the stroker merges the
* 'border' outlines with caps. The 'left' border receives all points,
* while the 'right' border becomes empty.
*
* Use the function @FT_Stroker_Export instead if you want to
* retrieve all borders at once.
* Use the function @FT_Stroker_Export instead if you want to retrieve
* all borders at once.
*/
FT_EXPORT( void )
FT_Stroker_ExportBorder( FT_Stroker stroker,
@ -619,16 +610,15 @@ FT_BEGIN_HEADER
FT_Outline* outline );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_GetCounts
*
* @description:
* Call this function once you have finished parsing your paths
* with the stroker. It returns the number of points and
* contours necessary to export all points/borders from the stroked
* outline/path.
* Call this function once you have finished parsing your paths with the
* stroker. It returns the number of points and contours necessary to
* export all points/borders from the stroked outline/path.
*
* @input:
* stroker ::
@ -650,18 +640,17 @@ FT_BEGIN_HEADER
FT_UInt *anum_contours );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_Export
*
* @description:
* Call this function after @FT_Stroker_GetBorderCounts to
* export all borders to your own @FT_Outline structure.
* Call this function after @FT_Stroker_GetBorderCounts to export all
* borders to your own @FT_Outline structure.
*
* Note that this function appends the border points and
* contours to your outline, but does not try to resize its
* arrays.
* Note that this function appends the border points and contours to your
* outline, but does not try to resize its arrays.
*
* @input:
* stroker ::
@ -675,7 +664,7 @@ FT_BEGIN_HEADER
FT_Outline* outline );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Stroker_Done
@ -685,13 +674,13 @@ FT_BEGIN_HEADER
*
* @input:
* stroker ::
* A stroker handle. Can be NULL.
* A stroker handle. Can be `NULL`.
*/
FT_EXPORT( void )
FT_Stroker_Done( FT_Stroker stroker );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Glyph_Stroke
@ -708,8 +697,7 @@ FT_BEGIN_HEADER
* A stroker handle.
*
* destroy ::
* A Boolean. If~1, the source glyph object is destroyed
* on success.
* A Boolean. If~1, the source glyph object is destroyed on success.
*
* @return:
* FreeType error code. 0~means success.
@ -719,8 +707,8 @@ FT_BEGIN_HEADER
*
* Adding stroke may yield a significantly wider and taller glyph
* depending on how large of a radius was used to stroke the glyph. You
* may need to manually adjust horizontal and vertical advance amounts
* to account for this added size.
* may need to manually adjust horizontal and vertical advance amounts to
* account for this added size.
*/
FT_EXPORT( FT_Error )
FT_Glyph_Stroke( FT_Glyph *pglyph,
@ -728,14 +716,14 @@ FT_BEGIN_HEADER
FT_Bool destroy );
/**************************************************************
/**************************************************************************
*
* @function:
* FT_Glyph_StrokeBorder
*
* @description:
* Stroke a given outline glyph object with a given stroker, but
* only return either its inside or outside border.
* Stroke a given outline glyph object with a given stroker, but only
* return either its inside or outside border.
*
* @inout:
* pglyph ::
@ -746,12 +734,11 @@ FT_BEGIN_HEADER
* A stroker handle.
*
* inside ::
* A Boolean. If~1, return the inside border, otherwise
* the outside border.
* A Boolean. If~1, return the inside border, otherwise the outside
* border.
*
* destroy ::
* A Boolean. If~1, the source glyph object is destroyed
* on success.
* A Boolean. If~1, the source glyph object is destroyed on success.
*
* @return:
* FreeType error code. 0~means success.
@ -761,8 +748,8 @@ FT_BEGIN_HEADER
*
* Adding stroke may yield a significantly wider and taller glyph
* depending on how large of a radius was used to stroke the glyph. You
* may need to manually adjust horizontal and vertical advance amounts
* to account for this added size.
* may need to manually adjust horizontal and vertical advance amounts to
* account for this added size.
*/
FT_EXPORT( FT_Error )
FT_Glyph_StrokeBorder( FT_Glyph *pglyph,

View File

@ -1,20 +1,20 @@
/***************************************************************************/
/* */
/* ftsynth.h */
/* */
/* FreeType synthesizing code for emboldening and slanting */
/* (specification). */
/* */
/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftsynth.h
*
* FreeType synthesizing code for emboldening and slanting
* (specification).
*
* Copyright (C) 2000-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
@ -35,7 +35,7 @@
/* Main reason for not lifting the functions in this module to a */
/* `standard' API is that the used parameters for emboldening and */
/* 'standard' API is that the used parameters for emboldening and */
/* slanting are not configurable. Consider the functions as a */
/* code resource that should be copied into the application and */
/* adapted to the particular needs. */
@ -57,7 +57,7 @@
FT_BEGIN_HEADER
/* Embolden a glyph by a `reasonable' value (which is highly a matter of */
/* Embolden a glyph by a 'reasonable' value (which is highly a matter of */
/* taste). This function is actually a convenience function, providing */
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
/* */

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftsystem.h */
/* */
/* FreeType low-level system interface definition (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftsystem.h
*
* FreeType low-level system interface definition (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTSYSTEM_H_
@ -26,34 +26,33 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* system_interface */
/* */
/* <Title> */
/* System Interface */
/* */
/* <Abstract> */
/* How FreeType manages memory and i/o. */
/* */
/* <Description> */
/* This section contains various definitions related to memory */
/* management and i/o access. You need to understand this */
/* information if you want to use a custom memory manager or you own */
/* i/o streams. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* system_interface
*
* @title:
* System Interface
*
* @abstract:
* How FreeType manages memory and i/o.
*
* @description:
* This section contains various definitions related to memory management
* and i/o access. You need to understand this information if you want to
* use a custom memory manager or you own i/o streams.
*
*/
/*************************************************************************/
/* */
/* M E M O R Y M A N A G E M E N T */
/* */
/*************************************************************************/
/**************************************************************************
*
* M E M O R Y M A N A G E M E N T
*
*/
/*************************************************************************
/**************************************************************************
*
* @type:
* FT_Memory
@ -66,13 +65,13 @@ FT_BEGIN_HEADER
typedef struct FT_MemoryRec_* FT_Memory;
/*************************************************************************
/**************************************************************************
*
* @functype:
* FT_Alloc_Func
*
* @description:
* A function used to allocate `size' bytes from `memory'.
* A function used to allocate `size` bytes from `memory`.
*
* @input:
* memory ::
@ -90,7 +89,7 @@ FT_BEGIN_HEADER
long size );
/*************************************************************************
/**************************************************************************
*
* @functype:
* FT_Free_Func
@ -111,7 +110,7 @@ FT_BEGIN_HEADER
void* block );
/*************************************************************************
/**************************************************************************
*
* @functype:
* FT_Realloc_Func
@ -146,7 +145,7 @@ FT_BEGIN_HEADER
void* block );
/*************************************************************************
/**************************************************************************
*
* @struct:
* FT_MemoryRec
@ -177,14 +176,14 @@ FT_BEGIN_HEADER
};
/*************************************************************************/
/* */
/* I / O M A N A G E M E N T */
/* */
/*************************************************************************/
/**************************************************************************
*
* I / O M A N A G E M E N T
*
*/
/*************************************************************************
/**************************************************************************
*
* @type:
* FT_Stream
@ -193,21 +192,21 @@ FT_BEGIN_HEADER
* A handle to an input stream.
*
* @also:
* See @FT_StreamRec for the publicly accessible fields of a given
* stream object.
* See @FT_StreamRec for the publicly accessible fields of a given stream
* object.
*
*/
typedef struct FT_StreamRec_* FT_Stream;
/*************************************************************************
/**************************************************************************
*
* @struct:
* FT_StreamDesc
*
* @description:
* A union type used to store either a long or a pointer. This is used
* to store a file descriptor or a `FILE*' in an input stream.
* to store a file descriptor or a `FILE*` in an input stream.
*
*/
typedef union FT_StreamDesc_
@ -218,7 +217,7 @@ FT_BEGIN_HEADER
} FT_StreamDesc;
/*************************************************************************
/**************************************************************************
*
* @functype:
* FT_Stream_IoFunc
@ -243,9 +242,8 @@ FT_BEGIN_HEADER
* The number of bytes effectively read by the stream.
*
* @note:
* This function might be called to perform a seek or skip operation
* with a `count' of~0. A non-zero return value then indicates an
* error.
* This function might be called to perform a seek or skip operation with
* a `count` of~0. A non-zero return value then indicates an error.
*
*/
typedef unsigned long
@ -255,7 +253,7 @@ FT_BEGIN_HEADER
unsigned long count );
/*************************************************************************
/**************************************************************************
*
* @functype:
* FT_Stream_CloseFunc
@ -265,14 +263,14 @@ FT_BEGIN_HEADER
*
* @input:
* stream ::
* A handle to the target stream.
* A handle to the target stream.
*
*/
typedef void
(*FT_Stream_CloseFunc)( FT_Stream stream );
/*************************************************************************
/**************************************************************************
*
* @struct:
* FT_StreamRec
@ -283,7 +281,7 @@ FT_BEGIN_HEADER
* @input:
* base ::
* For memory-based streams, this is the address of the first stream
* byte in memory. This field should always be set to NULL for
* byte in memory. This field should always be set to `NULL` for
* disk-based streams.
*
* size ::
@ -299,7 +297,7 @@ FT_BEGIN_HEADER
*
* descriptor ::
* This field is a union that can hold an integer or a pointer. It is
* used by stream implementations to store file descriptors or `FILE*'
* used by stream implementations to store file descriptors or `FILE*`
* pointers.
*
* pathname ::
@ -314,13 +312,13 @@ FT_BEGIN_HEADER
* The stream's close function.
*
* memory ::
* The memory manager to use to preload frames. This is set
* internally by FreeType and shouldn't be touched by stream
* implementations.
* The memory manager to use to preload frames. This is set internally
* by FreeType and shouldn't be touched by stream implementations.
*
* cursor ::
* This field is set and used internally by FreeType when parsing
* frames.
* frames. In particular, the `FT_GET_XXX` macros use this instead of
* the `pos` field.
*
* limit ::
* This field is set and used internally by FreeType when parsing

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* fttrigon.h */
/* */
/* FreeType trigonometric functions (specification). */
/* */
/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* fttrigon.h
*
* FreeType trigonometric functions (specification).
*
* Copyright (C) 2001-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTTRIGON_H_
@ -31,15 +31,15 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* computations */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* computations
*
*/
/*************************************************************************
/**************************************************************************
*
* @type:
* FT_Angle
@ -52,7 +52,7 @@ FT_BEGIN_HEADER
typedef FT_Fixed FT_Angle;
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_ANGLE_PI
@ -64,7 +64,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI ( 180L << 16 )
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_ANGLE_2PI
@ -76,7 +76,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_ANGLE_PI2
@ -88,7 +88,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_ANGLE_PI4
@ -100,7 +100,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Sin
@ -124,7 +124,7 @@ FT_BEGIN_HEADER
FT_Sin( FT_Angle angle );
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Cos
@ -148,7 +148,7 @@ FT_BEGIN_HEADER
FT_Cos( FT_Angle angle );
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Tan
@ -168,14 +168,14 @@ FT_BEGIN_HEADER
FT_Tan( FT_Angle angle );
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Atan2
*
* @description:
* Return the arc-tangent corresponding to a given vector (x,y) in
* the 2d plane.
* Return the arc-tangent corresponding to a given vector (x,y) in the 2d
* plane.
*
* @input:
* x ::
@ -193,7 +193,7 @@ FT_BEGIN_HEADER
FT_Fixed y );
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Angle_Diff
@ -210,7 +210,7 @@ FT_BEGIN_HEADER
* Second angle.
*
* @return:
* Constrained value of `value2-value1'.
* Constrained value of `angle2-angle1`.
*
*/
FT_EXPORT( FT_Angle )
@ -218,15 +218,15 @@ FT_BEGIN_HEADER
FT_Angle angle2 );
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Vector_Unit
*
* @description:
* Return the unit vector corresponding to a given angle. After the
* call, the value of `vec.x' will be `cos(angle)', and the value of
* `vec.y' will be `sin(angle)'.
* call, the value of `vec.x` will be `cos(angle)`, and the value of
* `vec.y` will be `sin(angle)`.
*
* This function is useful to retrieve both the sinus and cosinus of a
* given angle quickly.
@ -245,7 +245,7 @@ FT_BEGIN_HEADER
FT_Angle angle );
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Vector_Rotate
@ -267,7 +267,7 @@ FT_BEGIN_HEADER
FT_Angle angle );
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Vector_Length
@ -288,7 +288,7 @@ FT_BEGIN_HEADER
FT_Vector_Length( FT_Vector* vec );
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Vector_Polarize
@ -314,7 +314,7 @@ FT_BEGIN_HEADER
FT_Angle *angle );
/*************************************************************************
/**************************************************************************
*
* @function:
* FT_Vector_From_Polar

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* fttypes.h */
/* */
/* FreeType simple types definitions (specification only). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* fttypes.h
*
* FreeType simple types definitions (specification only).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTTYPES_H_
@ -31,326 +31,327 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* basic_types */
/* */
/* <Title> */
/* Basic Data Types */
/* */
/* <Abstract> */
/* The basic data types defined by the library. */
/* */
/* <Description> */
/* This section contains the basic data types defined by FreeType~2, */
/* ranging from simple scalar types to bitmap descriptors. More */
/* font-specific structures are defined in a different section. */
/* */
/* <Order> */
/* FT_Byte */
/* FT_Bytes */
/* FT_Char */
/* FT_Int */
/* FT_UInt */
/* FT_Int16 */
/* FT_UInt16 */
/* FT_Int32 */
/* FT_UInt32 */
/* FT_Int64 */
/* FT_UInt64 */
/* FT_Short */
/* FT_UShort */
/* FT_Long */
/* FT_ULong */
/* FT_Bool */
/* FT_Offset */
/* FT_PtrDist */
/* FT_String */
/* FT_Tag */
/* FT_Error */
/* FT_Fixed */
/* FT_Pointer */
/* FT_Pos */
/* FT_Vector */
/* FT_BBox */
/* FT_Matrix */
/* FT_FWord */
/* FT_UFWord */
/* FT_F2Dot14 */
/* FT_UnitVector */
/* FT_F26Dot6 */
/* FT_Data */
/* */
/* FT_MAKE_TAG */
/* */
/* FT_Generic */
/* FT_Generic_Finalizer */
/* */
/* FT_Bitmap */
/* FT_Pixel_Mode */
/* FT_Palette_Mode */
/* FT_Glyph_Format */
/* FT_IMAGE_TAG */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* basic_types
*
* @title:
* Basic Data Types
*
* @abstract:
* The basic data types defined by the library.
*
* @description:
* This section contains the basic data types defined by FreeType~2,
* ranging from simple scalar types to bitmap descriptors. More
* font-specific structures are defined in a different section.
*
* @order:
* FT_Byte
* FT_Bytes
* FT_Char
* FT_Int
* FT_UInt
* FT_Int16
* FT_UInt16
* FT_Int32
* FT_UInt32
* FT_Int64
* FT_UInt64
* FT_Short
* FT_UShort
* FT_Long
* FT_ULong
* FT_Bool
* FT_Offset
* FT_PtrDist
* FT_String
* FT_Tag
* FT_Error
* FT_Fixed
* FT_Pointer
* FT_Pos
* FT_Vector
* FT_BBox
* FT_Matrix
* FT_FWord
* FT_UFWord
* FT_F2Dot14
* FT_UnitVector
* FT_F26Dot6
* FT_Data
*
* FT_MAKE_TAG
*
* FT_Generic
* FT_Generic_Finalizer
*
* FT_Bitmap
* FT_Pixel_Mode
* FT_Palette_Mode
* FT_Glyph_Format
* FT_IMAGE_TAG
*
*/
/*************************************************************************/
/* */
/* <Type> */
/* FT_Bool */
/* */
/* <Description> */
/* A typedef of unsigned char, used for simple booleans. As usual, */
/* values 1 and~0 represent true and false, respectively. */
/* */
/**************************************************************************
*
* @type:
* FT_Bool
*
* @description:
* A typedef of unsigned char, used for simple booleans. As usual,
* values 1 and~0 represent true and false, respectively.
*/
typedef unsigned char FT_Bool;
/*************************************************************************/
/* */
/* <Type> */
/* FT_FWord */
/* */
/* <Description> */
/* A signed 16-bit integer used to store a distance in original font */
/* units. */
/* */
/**************************************************************************
*
* @type:
* FT_FWord
*
* @description:
* A signed 16-bit integer used to store a distance in original font
* units.
*/
typedef signed short FT_FWord; /* distance in FUnits */
/*************************************************************************/
/* */
/* <Type> */
/* FT_UFWord */
/* */
/* <Description> */
/* An unsigned 16-bit integer used to store a distance in original */
/* font units. */
/* */
/**************************************************************************
*
* @type:
* FT_UFWord
*
* @description:
* An unsigned 16-bit integer used to store a distance in original font
* units.
*/
typedef unsigned short FT_UFWord; /* unsigned distance */
/*************************************************************************/
/* */
/* <Type> */
/* FT_Char */
/* */
/* <Description> */
/* A simple typedef for the _signed_ char type. */
/* */
/**************************************************************************
*
* @type:
* FT_Char
*
* @description:
* A simple typedef for the _signed_ char type.
*/
typedef signed char FT_Char;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Byte */
/* */
/* <Description> */
/* A simple typedef for the _unsigned_ char type. */
/* */
/**************************************************************************
*
* @type:
* FT_Byte
*
* @description:
* A simple typedef for the _unsigned_ char type.
*/
typedef unsigned char FT_Byte;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Bytes */
/* */
/* <Description> */
/* A typedef for constant memory areas. */
/* */
/**************************************************************************
*
* @type:
* FT_Bytes
*
* @description:
* A typedef for constant memory areas.
*/
typedef const FT_Byte* FT_Bytes;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Tag */
/* */
/* <Description> */
/* A typedef for 32-bit tags (as used in the SFNT format). */
/* */
/**************************************************************************
*
* @type:
* FT_Tag
*
* @description:
* A typedef for 32-bit tags (as used in the SFNT format).
*/
typedef FT_UInt32 FT_Tag;
/*************************************************************************/
/* */
/* <Type> */
/* FT_String */
/* */
/* <Description> */
/* A simple typedef for the char type, usually used for strings. */
/* */
/**************************************************************************
*
* @type:
* FT_String
*
* @description:
* A simple typedef for the char type, usually used for strings.
*/
typedef char FT_String;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Short */
/* */
/* <Description> */
/* A typedef for signed short. */
/* */
/**************************************************************************
*
* @type:
* FT_Short
*
* @description:
* A typedef for signed short.
*/
typedef signed short FT_Short;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UShort */
/* */
/* <Description> */
/* A typedef for unsigned short. */
/* */
/**************************************************************************
*
* @type:
* FT_UShort
*
* @description:
* A typedef for unsigned short.
*/
typedef unsigned short FT_UShort;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int */
/* */
/* <Description> */
/* A typedef for the int type. */
/* */
/**************************************************************************
*
* @type:
* FT_Int
*
* @description:
* A typedef for the int type.
*/
typedef signed int FT_Int;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt */
/* */
/* <Description> */
/* A typedef for the unsigned int type. */
/* */
/**************************************************************************
*
* @type:
* FT_UInt
*
* @description:
* A typedef for the unsigned int type.
*/
typedef unsigned int FT_UInt;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Long */
/* */
/* <Description> */
/* A typedef for signed long. */
/* */
/**************************************************************************
*
* @type:
* FT_Long
*
* @description:
* A typedef for signed long.
*/
typedef signed long FT_Long;
/*************************************************************************/
/* */
/* <Type> */
/* FT_ULong */
/* */
/* <Description> */
/* A typedef for unsigned long. */
/* */
/**************************************************************************
*
* @type:
* FT_ULong
*
* @description:
* A typedef for unsigned long.
*/
typedef unsigned long FT_ULong;
/*************************************************************************/
/* */
/* <Type> */
/* FT_F2Dot14 */
/* */
/* <Description> */
/* A signed 2.14 fixed-point type used for unit vectors. */
/* */
/**************************************************************************
*
* @type:
* FT_F2Dot14
*
* @description:
* A signed 2.14 fixed-point type used for unit vectors.
*/
typedef signed short FT_F2Dot14;
/*************************************************************************/
/* */
/* <Type> */
/* FT_F26Dot6 */
/* */
/* <Description> */
/* A signed 26.6 fixed-point type used for vectorial pixel */
/* coordinates. */
/* */
/**************************************************************************
*
* @type:
* FT_F26Dot6
*
* @description:
* A signed 26.6 fixed-point type used for vectorial pixel coordinates.
*/
typedef signed long FT_F26Dot6;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Fixed */
/* */
/* <Description> */
/* This type is used to store 16.16 fixed-point values, like scaling */
/* values or matrix coefficients. */
/* */
/**************************************************************************
*
* @type:
* FT_Fixed
*
* @description:
* This type is used to store 16.16 fixed-point values, like scaling
* values or matrix coefficients.
*/
typedef signed long FT_Fixed;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Error */
/* */
/* <Description> */
/* The FreeType error code type. A value of~0 is always interpreted */
/* as a successful operation. */
/* */
/**************************************************************************
*
* @type:
* FT_Error
*
* @description:
* The FreeType error code type. A value of~0 is always interpreted as a
* successful operation.
*/
typedef int FT_Error;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Pointer */
/* */
/* <Description> */
/* A simple typedef for a typeless pointer. */
/* */
/**************************************************************************
*
* @type:
* FT_Pointer
*
* @description:
* A simple typedef for a typeless pointer.
*/
typedef void* FT_Pointer;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Offset */
/* */
/* <Description> */
/* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */
/* _unsigned_ integer type used to express a file size or position, */
/* or a memory block size. */
/* */
/**************************************************************************
*
* @type:
* FT_Offset
*
* @description:
* This is equivalent to the ANSI~C `size_t` type, i.e., the largest
* _unsigned_ integer type used to express a file size or position, or a
* memory block size.
*/
typedef size_t FT_Offset;
/*************************************************************************/
/* */
/* <Type> */
/* FT_PtrDist */
/* */
/* <Description> */
/* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */
/* largest _signed_ integer type used to express the distance */
/* between two pointers. */
/* */
/**************************************************************************
*
* @type:
* FT_PtrDist
*
* @description:
* This is equivalent to the ANSI~C `ptrdiff_t` type, i.e., the largest
* _signed_ integer type used to express the distance between two
* pointers.
*/
typedef ft_ptrdiff_t FT_PtrDist;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_UnitVector */
/* */
/* <Description> */
/* A simple structure used to store a 2D vector unit vector. Uses */
/* FT_F2Dot14 types. */
/* */
/* <Fields> */
/* x :: Horizontal coordinate. */
/* */
/* y :: Vertical coordinate. */
/* */
/**************************************************************************
*
* @struct:
* FT_UnitVector
*
* @description:
* A simple structure used to store a 2D vector unit vector. Uses
* FT_F2Dot14 types.
*
* @fields:
* x ::
* Horizontal coordinate.
*
* y ::
* Vertical coordinate.
*/
typedef struct FT_UnitVector_
{
FT_F2Dot14 x;
@ -359,29 +360,33 @@ FT_BEGIN_HEADER
} FT_UnitVector;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Matrix */
/* */
/* <Description> */
/* A simple structure used to store a 2x2 matrix. Coefficients are */
/* in 16.16 fixed-point format. The computation performed is: */
/* */
/* { */
/* x' = x*xx + y*xy */
/* y' = x*yx + y*yy */
/* } */
/* */
/* <Fields> */
/* xx :: Matrix coefficient. */
/* */
/* xy :: Matrix coefficient. */
/* */
/* yx :: Matrix coefficient. */
/* */
/* yy :: Matrix coefficient. */
/* */
/**************************************************************************
*
* @struct:
* FT_Matrix
*
* @description:
* A simple structure used to store a 2x2 matrix. Coefficients are in
* 16.16 fixed-point format. The computation performed is:
*
* ```
* x' = x*xx + y*xy
* y' = x*yx + y*yy
* ```
*
* @fields:
* xx ::
* Matrix coefficient.
*
* xy ::
* Matrix coefficient.
*
* yx ::
* Matrix coefficient.
*
* yy ::
* Matrix coefficient.
*/
typedef struct FT_Matrix_
{
FT_Fixed xx, xy;
@ -390,19 +395,21 @@ FT_BEGIN_HEADER
} FT_Matrix;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Data */
/* */
/* <Description> */
/* Read-only binary data represented as a pointer and a length. */
/* */
/* <Fields> */
/* pointer :: The data. */
/* */
/* length :: The length of the data in bytes. */
/* */
/**************************************************************************
*
* @struct:
* FT_Data
*
* @description:
* Read-only binary data represented as a pointer and a length.
*
* @fields:
* pointer ::
* The data.
*
* length ::
* The length of the data in bytes.
*/
typedef struct FT_Data_
{
const FT_Byte* pointer;
@ -411,51 +418,52 @@ FT_BEGIN_HEADER
} FT_Data;
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Generic_Finalizer */
/* */
/* <Description> */
/* Describe a function used to destroy the `client' data of any */
/* FreeType object. See the description of the @FT_Generic type for */
/* details of usage. */
/* */
/* <Input> */
/* The address of the FreeType object that is under finalization. */
/* Its client data is accessed through its `generic' field. */
/* */
/**************************************************************************
*
* @functype:
* FT_Generic_Finalizer
*
* @description:
* Describe a function used to destroy the 'client' data of any FreeType
* object. See the description of the @FT_Generic type for details of
* usage.
*
* @input:
* The address of the FreeType object that is under finalization. Its
* client data is accessed through its `generic` field.
*/
typedef void (*FT_Generic_Finalizer)( void* object );
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Generic */
/* */
/* <Description> */
/* Client applications often need to associate their own data to a */
/* variety of FreeType core objects. For example, a text layout API */
/* might want to associate a glyph cache to a given size object. */
/* */
/* Some FreeType object contains a `generic' field, of type */
/* FT_Generic, which usage is left to client applications and font */
/* servers. */
/* */
/* It can be used to store a pointer to client-specific data, as well */
/* as the address of a `finalizer' function, which will be called by */
/* FreeType when the object is destroyed (for example, the previous */
/* client example would put the address of the glyph cache destructor */
/* in the `finalizer' field). */
/* */
/* <Fields> */
/* data :: A typeless pointer to any client-specified data. This */
/* field is completely ignored by the FreeType library. */
/* */
/* finalizer :: A pointer to a `generic finalizer' function, which */
/* will be called when the object is destroyed. If this */
/* field is set to NULL, no code will be called. */
/* */
/**************************************************************************
*
* @struct:
* FT_Generic
*
* @description:
* Client applications often need to associate their own data to a
* variety of FreeType core objects. For example, a text layout API
* might want to associate a glyph cache to a given size object.
*
* Some FreeType object contains a `generic` field, of type `FT_Generic`,
* which usage is left to client applications and font servers.
*
* It can be used to store a pointer to client-specific data, as well as
* the address of a 'finalizer' function, which will be called by
* FreeType when the object is destroyed (for example, the previous
* client example would put the address of the glyph cache destructor in
* the `finalizer` field).
*
* @fields:
* data ::
* A typeless pointer to any client-specified data. This field is
* completely ignored by the FreeType library.
*
* finalizer ::
* A pointer to a 'generic finalizer' function, which will be called
* when the object is destroyed. If this field is set to `NULL`, no
* code will be called.
*/
typedef struct FT_Generic_
{
void* data;
@ -464,19 +472,19 @@ FT_BEGIN_HEADER
} FT_Generic;
/*************************************************************************/
/* */
/* <Macro> */
/* FT_MAKE_TAG */
/* */
/* <Description> */
/* This macro converts four-letter tags that are used to label */
/* TrueType tables into an unsigned long, to be used within FreeType. */
/* */
/* <Note> */
/* The produced values *must* be 32-bit integers. Don't redefine */
/* this macro. */
/* */
/**************************************************************************
*
* @macro:
* FT_MAKE_TAG
*
* @description:
* This macro converts four-letter tags that are used to label TrueType
* tables into an unsigned long, to be used within FreeType.
*
* @note:
* The produced values **must** be 32-bit integers. Don't redefine this
* macro.
*/
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
(FT_Tag) \
( ( (FT_ULong)_x1 << 24 ) | \
@ -494,53 +502,56 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/* */
/* <Section> */
/* list_processing */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* list_processing
*
*/
/*************************************************************************/
/* */
/* <Type> */
/* FT_ListNode */
/* */
/* <Description> */
/* Many elements and objects in FreeType are listed through an */
/* @FT_List record (see @FT_ListRec). As its name suggests, an */
/* FT_ListNode is a handle to a single list element. */
/* */
/**************************************************************************
*
* @type:
* FT_ListNode
*
* @description:
* Many elements and objects in FreeType are listed through an @FT_List
* record (see @FT_ListRec). As its name suggests, an FT_ListNode is a
* handle to a single list element.
*/
typedef struct FT_ListNodeRec_* FT_ListNode;
/*************************************************************************/
/* */
/* <Type> */
/* FT_List */
/* */
/* <Description> */
/* A handle to a list record (see @FT_ListRec). */
/* */
/**************************************************************************
*
* @type:
* FT_List
*
* @description:
* A handle to a list record (see @FT_ListRec).
*/
typedef struct FT_ListRec_* FT_List;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_ListNodeRec */
/* */
/* <Description> */
/* A structure used to hold a single list element. */
/* */
/* <Fields> */
/* prev :: The previous element in the list. NULL if first. */
/* */
/* next :: The next element in the list. NULL if last. */
/* */
/* data :: A typeless pointer to the listed object. */
/* */
/**************************************************************************
*
* @struct:
* FT_ListNodeRec
*
* @description:
* A structure used to hold a single list element.
*
* @fields:
* prev ::
* The previous element in the list. `NULL` if first.
*
* next ::
* The next element in the list. `NULL` if last.
*
* data ::
* A typeless pointer to the listed object.
*/
typedef struct FT_ListNodeRec_
{
FT_ListNode prev;
@ -550,20 +561,22 @@ FT_BEGIN_HEADER
} FT_ListNodeRec;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_ListRec */
/* */
/* <Description> */
/* A structure used to hold a simple doubly-linked list. These are */
/* used in many parts of FreeType. */
/* */
/* <Fields> */
/* head :: The head (first element) of doubly-linked list. */
/* */
/* tail :: The tail (last element) of doubly-linked list. */
/* */
/**************************************************************************
*
* @struct:
* FT_ListRec
*
* @description:
* A structure used to hold a simple doubly-linked list. These are used
* in many parts of FreeType.
*
* @fields:
* head ::
* The head (first element) of doubly-linked list.
*
* tail ::
* The tail (last element) of doubly-linked list.
*/
typedef struct FT_ListRec_
{
FT_ListNode head;
@ -575,13 +588,13 @@ FT_BEGIN_HEADER
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
#define FT_BOOL( x ) ( (FT_Bool)( x ) )
#define FT_BOOL( x ) ( (FT_Bool)( (x) != 0 ) )
/* concatenate C tokens */
#define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
/* see `ftmoderr.h' for descriptions of the following macros */
/* see `ftmoderr.h` for descriptions of the following macros */
#define FT_ERR( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftwinfnt.h */
/* */
/* FreeType API for accessing Windows fnt-specific data. */
/* */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftwinfnt.h
*
* FreeType API for accessing Windows fnt-specific data.
*
* Copyright (C) 2003-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTWINFNT_H_
@ -32,44 +32,43 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* winfnt_fonts */
/* */
/* <Title> */
/* Window FNT Files */
/* */
/* <Abstract> */
/* Windows FNT specific API. */
/* */
/* <Description> */
/* This section contains the declaration of Windows FNT specific */
/* functions. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* winfnt_fonts
*
* @title:
* Window FNT Files
*
* @abstract:
* Windows FNT-specific API.
*
* @description:
* This section contains the declaration of Windows FNT-specific
* functions.
*
*/
/*************************************************************************
/**************************************************************************
*
* @enum:
* FT_WinFNT_ID_XXX
*
* @description:
* A list of valid values for the `charset' byte in
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
* encodings (except for cp1361) can be found at
* ftp://ftp.unicode.org/Public in the MAPPINGS/VENDORS/MICSFT/WINDOWS
* subdirectory. cp1361 is roughly a superset of
* MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
* A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec.
* Exact mapping tables for the various 'cpXXXX' encodings (except for
* 'cp1361') can be found at 'ftp://ftp.unicode.org/Public/' in the
* `MAPPINGS/VENDORS/MICSFT/WINDOWS` subdirectory. 'cp1361' is roughly a
* superset of `MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT`.
*
* @values:
* FT_WinFNT_ID_DEFAULT ::
* This is used for font enumeration and font creation as a
* `don't care' value. Valid font files don't contain this value.
* When querying for information about the character set of the font
* that is currently selected into a specified device context, this
* return value (of the related Windows API) simply denotes failure.
* This is used for font enumeration and font creation as a 'don't
* care' value. Valid font files don't contain this value. When
* querying for information about the character set of the font that is
* currently selected into a specified device context, this return
* value (of the related Windows API) simply denotes failure.
*
* FT_WinFNT_ID_SYMBOL ::
* There is no known mapping table available.
@ -80,26 +79,27 @@ FT_BEGIN_HEADER
* FT_WinFNT_ID_OEM ::
* From Michael Poettgen <michael@poettgen.de>:
*
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
* is used for the charset of vector fonts, like `modern.fon',
* `roman.fon', and `script.fon' on Windows.
* The 'Windows Font Mapping' article says that `FT_WinFNT_ID_OEM` is
* used for the charset of vector fonts, like `modern.fon`,
* `roman.fon`, and `script.fon` on Windows.
*
* The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
* specifies a character set that is operating-system dependent.
* The 'CreateFont' documentation says: The `FT_WinFNT_ID_OEM` value
* specifies a character set that is operating-system dependent.
*
* The `IFIMETRICS' documentation from the `Windows Driver
* Development Kit' says: This font supports an OEM-specific
* character set. The OEM character set is system dependent.
* The 'IFIMETRICS' documentation from the 'Windows Driver Development
* Kit' says: This font supports an OEM-specific character set. The
* OEM character set is system dependent.
*
* In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
* second default codepage that most international versions of
* Windows have. It is one of the OEM codepages from
* In general OEM, as opposed to ANSI (i.e., 'cp1252'), denotes the
* second default codepage that most international versions of Windows
* have. It is one of the OEM codepages from
*
* https://msdn.microsoft.com/en-us/goglobal/bb964655,
* https://docs.microsoft.com/en-us/windows/desktop/intl/code-page-identifiers
* ,
*
* and is used for the `DOS boxes', to support legacy applications.
* A German Windows version for example usually uses ANSI codepage
* 1252 and OEM codepage 850.
* and is used for the 'DOS boxes', to support legacy applications. A
* German Windows version for example usually uses ANSI codepage 1252
* and OEM codepage 850.
*
* FT_WinFNT_ID_CP874 ::
* A superset of Thai TIS 620 and ISO 8859-11.
@ -112,8 +112,8 @@ FT_BEGIN_HEADER
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP949 ::
* A superset of Korean Hangul KS~C 5601-1987 (with different
* ordering and minor deviations).
* A superset of Korean Hangul KS~C 5601-1987 (with different ordering
* and minor deviations).
*
* FT_WinFNT_ID_CP950 ::
* A superset of traditional Chinese Big~5 ETen (with different
@ -173,14 +173,14 @@ FT_BEGIN_HEADER
#define FT_WinFNT_ID_OEM 255
/*************************************************************************/
/* */
/* <Struct> */
/* FT_WinFNT_HeaderRec */
/* */
/* <Description> */
/* Windows FNT Header info. */
/* */
/**************************************************************************
*
* @struct:
* FT_WinFNT_HeaderRec
*
* @description:
* Windows FNT Header info.
*/
typedef struct FT_WinFNT_HeaderRec_
{
FT_UShort version;
@ -223,18 +223,18 @@ FT_BEGIN_HEADER
} FT_WinFNT_HeaderRec;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_WinFNT_Header */
/* */
/* <Description> */
/* A handle to an @FT_WinFNT_HeaderRec structure. */
/* */
/**************************************************************************
*
* @struct:
* FT_WinFNT_Header
*
* @description:
* A handle to an @FT_WinFNT_HeaderRec structure.
*/
typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
/**********************************************************************
/**************************************************************************
*
* @function:
* FT_Get_WinFNT_Header
@ -243,10 +243,12 @@ FT_BEGIN_HEADER
* Retrieve a Windows FNT font info header.
*
* @input:
* face :: A handle to the input face.
* face ::
* A handle to the input face.
*
* @output:
* aheader :: The WinFNT header.
* aheader ::
* The WinFNT header.
*
* @return:
* FreeType error code. 0~means success.

View File

@ -1,73 +1,73 @@
/***************************************************************************/
/* */
/* autohint.h */
/* */
/* High-level `autohint' module-specific interface (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* autohint.h
*
* High-level 'autohint' module-specific interface (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* The auto-hinter is used to load and automatically hint glyphs if a */
/* format-specific hinter isn't available. */
/* */
/*************************************************************************/
/**************************************************************************
*
* The auto-hinter is used to load and automatically hint glyphs if a
* format-specific hinter isn't available.
*
*/
#ifndef AUTOHINT_H_
#define AUTOHINT_H_
/*************************************************************************/
/* */
/* A small technical note regarding automatic hinting in order to */
/* clarify this module interface. */
/* */
/* An automatic hinter might compute two kinds of data for a given face: */
/* */
/* - global hints: Usually some metrics that describe global properties */
/* of the face. It is computed by scanning more or less */
/* aggressively the glyphs in the face, and thus can be */
/* very slow to compute (even if the size of global */
/* hints is really small). */
/* */
/* - glyph hints: These describe some important features of the glyph */
/* outline, as well as how to align them. They are */
/* generally much faster to compute than global hints. */
/* */
/* The current FreeType auto-hinter does a pretty good job while */
/* performing fast computations for both global and glyph hints. */
/* However, we might be interested in introducing more complex and */
/* powerful algorithms in the future, like the one described in the John */
/* D. Hobby paper, which unfortunately requires a lot more horsepower. */
/* */
/* Because a sufficiently sophisticated font management system would */
/* typically implement an LRU cache of opened face objects to reduce */
/* memory usage, it is a good idea to be able to avoid recomputing */
/* global hints every time the same face is re-opened. */
/* */
/* We thus provide the ability to cache global hints outside of the face */
/* object, in order to speed up font re-opening time. Of course, this */
/* feature is purely optional, so most client programs won't even notice */
/* it. */
/* */
/* I initially thought that it would be a good idea to cache the glyph */
/* hints too. However, my general idea now is that if you really need */
/* to cache these too, you are simply in need of a new font format, */
/* where all this information could be stored within the font file and */
/* decoded on the fly. */
/* */
/*************************************************************************/
/**************************************************************************
*
* A small technical note regarding automatic hinting in order to clarify
* this module interface.
*
* An automatic hinter might compute two kinds of data for a given face:
*
* - global hints: Usually some metrics that describe global properties
* of the face. It is computed by scanning more or less
* aggressively the glyphs in the face, and thus can be
* very slow to compute (even if the size of global hints
* is really small).
*
* - glyph hints: These describe some important features of the glyph
* outline, as well as how to align them. They are
* generally much faster to compute than global hints.
*
* The current FreeType auto-hinter does a pretty good job while performing
* fast computations for both global and glyph hints. However, we might be
* interested in introducing more complex and powerful algorithms in the
* future, like the one described in the John D. Hobby paper, which
* unfortunately requires a lot more horsepower.
*
* Because a sufficiently sophisticated font management system would
* typically implement an LRU cache of opened face objects to reduce memory
* usage, it is a good idea to be able to avoid recomputing global hints
* every time the same face is re-opened.
*
* We thus provide the ability to cache global hints outside of the face
* object, in order to speed up font re-opening time. Of course, this
* feature is purely optional, so most client programs won't even notice
* it.
*
* I initially thought that it would be a good idea to cache the glyph
* hints too. However, my general idea now is that if you really need to
* cache these too, you are simply in need of a new font format, where all
* this information could be stored within the font file and decoded on the
* fly.
*
*/
#include <ft2build.h>
@ -80,27 +80,31 @@ FT_BEGIN_HEADER
typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_AutoHinter_GlobalGetFunc */
/* */
/* <Description> */
/* Retrieve the global hints computed for a given face object. The */
/* resulting data is dissociated from the face and will survive a */
/* call to FT_Done_Face(). It must be discarded through the API */
/* FT_AutoHinter_GlobalDoneFunc(). */
/* */
/* <Input> */
/* hinter :: A handle to the source auto-hinter. */
/* */
/* face :: A handle to the source face object. */
/* */
/* <Output> */
/* global_hints :: A typeless pointer to the global hints. */
/* */
/* global_len :: The size in bytes of the global hints. */
/* */
/**************************************************************************
*
* @functype:
* FT_AutoHinter_GlobalGetFunc
*
* @description:
* Retrieve the global hints computed for a given face object. The
* resulting data is dissociated from the face and will survive a call to
* FT_Done_Face(). It must be discarded through the API
* FT_AutoHinter_GlobalDoneFunc().
*
* @input:
* hinter ::
* A handle to the source auto-hinter.
*
* face ::
* A handle to the source face object.
*
* @output:
* global_hints ::
* A typeless pointer to the global hints.
*
* global_len ::
* The size in bytes of the global hints.
*/
typedef void
(*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter,
FT_Face face,
@ -108,69 +112,76 @@ FT_BEGIN_HEADER
long* global_len );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_AutoHinter_GlobalDoneFunc */
/* */
/* <Description> */
/* Discard the global hints retrieved through */
/* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */
/* are freed from memory. */
/* */
/* <Input> */
/* hinter :: A handle to the auto-hinter module. */
/* */
/* global :: A pointer to retrieved global hints to discard. */
/* */
/**************************************************************************
*
* @functype:
* FT_AutoHinter_GlobalDoneFunc
*
* @description:
* Discard the global hints retrieved through
* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints are
* freed from memory.
*
* @input:
* hinter ::
* A handle to the auto-hinter module.
*
* global ::
* A pointer to retrieved global hints to discard.
*/
typedef void
(*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter,
void* global );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_AutoHinter_GlobalResetFunc */
/* */
/* <Description> */
/* This function is used to recompute the global metrics in a given */
/* font. This is useful when global font data changes (e.g. Multiple */
/* Masters fonts where blend coordinates change). */
/* */
/* <Input> */
/* hinter :: A handle to the source auto-hinter. */
/* */
/* face :: A handle to the face. */
/* */
/**************************************************************************
*
* @functype:
* FT_AutoHinter_GlobalResetFunc
*
* @description:
* This function is used to recompute the global metrics in a given font.
* This is useful when global font data changes (e.g. Multiple Masters
* fonts where blend coordinates change).
*
* @input:
* hinter ::
* A handle to the source auto-hinter.
*
* face ::
* A handle to the face.
*/
typedef void
(*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter,
FT_Face face );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_AutoHinter_GlyphLoadFunc */
/* */
/* <Description> */
/* This function is used to load, scale, and automatically hint a */
/* glyph from a given face. */
/* */
/* <Input> */
/* face :: A handle to the face. */
/* */
/* glyph_index :: The glyph index. */
/* */
/* load_flags :: The load flags. */
/* */
/* <Note> */
/* This function is capable of loading composite glyphs by hinting */
/* each sub-glyph independently (which improves quality). */
/* */
/* It will call the font driver with @FT_Load_Glyph, with */
/* @FT_LOAD_NO_SCALE set. */
/* */
/**************************************************************************
*
* @functype:
* FT_AutoHinter_GlyphLoadFunc
*
* @description:
* This function is used to load, scale, and automatically hint a glyph
* from a given face.
*
* @input:
* face ::
* A handle to the face.
*
* glyph_index ::
* The glyph index.
*
* load_flags ::
* The load flags.
*
* @note:
* This function is capable of loading composite glyphs by hinting each
* sub-glyph independently (which improves quality).
*
* It will call the font driver with @FT_Load_Glyph, with
* @FT_LOAD_NO_SCALE set.
*/
typedef FT_Error
(*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter,
FT_GlyphSlot slot,
@ -179,14 +190,14 @@ FT_BEGIN_HEADER
FT_Int32 load_flags );
/*************************************************************************/
/* */
/* <Struct> */
/* FT_AutoHinter_InterfaceRec */
/* */
/* <Description> */
/* The auto-hinter module's interface. */
/* */
/**************************************************************************
*
* @struct:
* FT_AutoHinter_InterfaceRec
*
* @description:
* The auto-hinter module's interface.
*/
typedef struct FT_AutoHinter_InterfaceRec_
{
FT_AutoHinter_GlobalResetFunc reset_face;
@ -197,8 +208,6 @@ FT_BEGIN_HEADER
} FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_AUTOHINTER_INTERFACE( \
class_, \
reset_face_, \
@ -214,27 +223,6 @@ FT_BEGIN_HEADER
load_glyph_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_AUTOHINTER_INTERFACE( \
class_, \
reset_face_, \
get_global_hints_, \
done_global_hints_, \
load_glyph_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_AutoHinter_InterfaceRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->reset_face = reset_face_; \
clazz->get_global_hints = get_global_hints_; \
clazz->done_global_hints = done_global_hints_; \
clazz->load_glyph = load_glyph_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* cffotypes.h */
/* */
/* Basic OpenType/CFF object type definitions (specification). */
/* */
/* Copyright 2017-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* cffotypes.h
*
* Basic OpenType/CFF object type definitions (specification).
*
* Copyright (C) 2017-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef CFFOTYPES_H_
@ -33,14 +33,14 @@ FT_BEGIN_HEADER
typedef TT_Face CFF_Face;
/*************************************************************************/
/* */
/* <Type> */
/* CFF_Size */
/* */
/* <Description> */
/* A handle to an OpenType size object. */
/* */
/**************************************************************************
*
* @type:
* CFF_Size
*
* @description:
* A handle to an OpenType size object.
*/
typedef struct CFF_SizeRec_
{
FT_SizeRec root;
@ -49,14 +49,14 @@ FT_BEGIN_HEADER
} CFF_SizeRec, *CFF_Size;
/*************************************************************************/
/* */
/* <Type> */
/* CFF_GlyphSlot */
/* */
/* <Description> */
/* A handle to an OpenType glyph slot object. */
/* */
/**************************************************************************
*
* @type:
* CFF_GlyphSlot
*
* @description:
* A handle to an OpenType glyph slot object.
*/
typedef struct CFF_GlyphSlotRec_
{
FT_GlyphSlotRec root;
@ -70,14 +70,14 @@ FT_BEGIN_HEADER
} CFF_GlyphSlotRec, *CFF_GlyphSlot;
/*************************************************************************/
/* */
/* <Type> */
/* CFF_Internal */
/* */
/* <Description> */
/* The interface to the `internal' field of `FT_Size'. */
/* */
/**************************************************************************
*
* @type:
* CFF_Internal
*
* @description:
* The interface to the 'internal' field of `FT_Size`.
*/
typedef struct CFF_InternalRec_
{
PSH_Globals topfont;
@ -86,10 +86,10 @@ FT_BEGIN_HEADER
} CFF_InternalRec, *CFF_Internal;
/*************************************************************************/
/* */
/* Subglyph transformation record. */
/* */
/**************************************************************************
*
* Subglyph transformation record.
*/
typedef struct CFF_Transform_
{
FT_Fixed xx, xy; /* transformation matrix coefficients */

View File

@ -1,20 +1,20 @@
/***************************************************************************/
/* */
/* cfftypes.h */
/* */
/* Basic OpenType/CFF type definitions and interface (specification */
/* only). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* cfftypes.h
*
* Basic OpenType/CFF type definitions and interface (specification
* only).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef CFFTYPES_H_
@ -33,34 +33,39 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
/* CFF_IndexRec */
/* */
/* <Description> */
/* A structure used to model a CFF Index table. */
/* */
/* <Fields> */
/* stream :: The source input stream. */
/* */
/* start :: The position of the first index byte in the */
/* input stream. */
/* */
/* count :: The number of elements in the index. */
/* */
/* off_size :: The size in bytes of object offsets in index. */
/* */
/* data_offset :: The position of first data byte in the index's */
/* bytes. */
/* */
/* data_size :: The size of the data table in this index. */
/* */
/* offsets :: A table of element offsets in the index. Must be */
/* loaded explicitly. */
/* */
/* bytes :: If the index is loaded in memory, its bytes. */
/* */
/**************************************************************************
*
* @struct:
* CFF_IndexRec
*
* @description:
* A structure used to model a CFF Index table.
*
* @fields:
* stream ::
* The source input stream.
*
* start ::
* The position of the first index byte in the input stream.
*
* count ::
* The number of elements in the index.
*
* off_size ::
* The size in bytes of object offsets in index.
*
* data_offset ::
* The position of first data byte in the index's bytes.
*
* data_size ::
* The size of the data table in this index.
*
* offsets ::
* A table of element offsets in the index. Must be loaded explicitly.
*
* bytes ::
* If the index is loaded in memory, its bytes.
*/
typedef struct CFF_IndexRec_
{
FT_Stream stream;

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftcalc.h */
/* */
/* Arithmetic computations (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftcalc.h
*
* Arithmetic computations (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTCALC_H_
@ -27,11 +27,11 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
/* */
/*************************************************************************/
/**************************************************************************
*
* FT_MulDiv() and FT_MulFix() are declared in freetype.h.
*
*/
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
/* Provide assembler fragments for performance-critical functions. */
@ -246,29 +246,32 @@ FT_BEGIN_HEADER
#endif
/*************************************************************************/
/* */
/* <Function> */
/* FT_MulDiv_No_Round */
/* */
/* <Description> */
/* A very simple function used to perform the computation `(a*b)/c' */
/* (without rounding) with maximum accuracy (it uses a 64-bit */
/* intermediate integer whenever necessary). */
/* */
/* This function isn't necessarily as fast as some processor specific */
/* operations, but is at least completely portable. */
/* */
/* <Input> */
/* a :: The first multiplier. */
/* b :: The second multiplier. */
/* c :: The divisor. */
/* */
/* <Return> */
/* The result of `(a*b)/c'. This function never traps when trying to */
/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
/* on the signs of `a' and `b'. */
/* */
/**************************************************************************
*
* @function:
* FT_MulDiv_No_Round
*
* @description:
* A very simple function used to perform the computation '(a*b)/c'
* (without rounding) with maximum accuracy (it uses a 64-bit
* intermediate integer whenever necessary).
*
* This function isn't necessarily as fast as some processor-specific
* operations, but is at least completely portable.
*
* @input:
* a ::
* The first multiplier.
* b ::
* The second multiplier.
* c ::
* The divisor.
*
* @return:
* The result of '(a*b)/c'. This function never traps when trying to
* divide by zero; it simply returns 'MaxInt' or 'MinInt' depending on
* the signs of 'a' and 'b'.
*/
FT_BASE( FT_Long )
FT_MulDiv_No_Round( FT_Long a,
FT_Long b,
@ -276,12 +279,11 @@ FT_BEGIN_HEADER
/*
* A variant of FT_Matrix_Multiply which scales its result afterwards.
* The idea is that both `a' and `b' are scaled by factors of 10 so that
* the values are as precise as possible to get a correct result during
* the 64bit multiplication. Let `sa' and `sb' be the scaling factors of
* `a' and `b', respectively, then the scaling factor of the result is
* `sa*sb'.
* A variant of FT_Matrix_Multiply which scales its result afterwards. The
* idea is that both `a' and `b' are scaled by factors of 10 so that the
* values are as precise as possible to get a correct result during the
* 64bit multiplication. Let `sa' and `sb' be the scaling factors of `a'
* and `b', respectively, then the scaling factor of the result is `sa*sb'.
*/
FT_BASE( void )
FT_Matrix_Multiply_Scaled( const FT_Matrix* a,
@ -290,8 +292,23 @@ FT_BEGIN_HEADER
/*
* A variant of FT_Vector_Transform. See comments for
* FT_Matrix_Multiply_Scaled.
* Check a matrix. If the transformation would lead to extreme shear or
* extreme scaling, for example, return 0. If everything is OK, return 1.
*
* Based on geometric considerations we use the following inequality to
* identify a degenerate matrix.
*
* 50 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
*
* Value 50 is heuristic.
*/
FT_BASE( FT_Bool )
FT_Matrix_Check( const FT_Matrix* matrix );
/*
* A variant of FT_Vector_Transform. See comments for
* FT_Matrix_Multiply_Scaled.
*/
FT_BASE( void )
FT_Vector_Transform_Scaled( FT_Vector* vector,
@ -300,22 +317,22 @@ FT_BEGIN_HEADER
/*
* This function normalizes a vector and returns its original length.
* The normalized vector is a 16.16 fixed-point unit vector with length
* close to 0x10000. The accuracy of the returned length is limited to
* 16 bits also. The function utilizes quick inverse square root
* approximation without divisions and square roots relying on Newton's
* iterations instead.
* This function normalizes a vector and returns its original length. The
* normalized vector is a 16.16 fixed-point unit vector with length close
* to 0x10000. The accuracy of the returned length is limited to 16 bits
* also. The function utilizes quick inverse square root approximation
* without divisions and square roots relying on Newton's iterations
* instead.
*/
FT_BASE( FT_UInt32 )
FT_Vector_NormLen( FT_Vector* vector );
/*
* Return -1, 0, or +1, depending on the orientation of a given corner.
* We use the Cartesian coordinate system, with positive vertical values
* going upwards. The function returns +1 if the corner turns to the
* left, -1 to the right, and 0 for undecidable cases.
* Return -1, 0, or +1, depending on the orientation of a given corner. We
* use the Cartesian coordinate system, with positive vertical values going
* upwards. The function returns +1 if the corner turns to the left, -1 to
* the right, and 0 for undecidable cases.
*/
FT_BASE( FT_Int )
ft_corner_orientation( FT_Pos in_x,
@ -325,9 +342,9 @@ FT_BEGIN_HEADER
/*
* Return TRUE if a corner is flat or nearly flat. This is equivalent to
* saying that the corner point is close to its neighbors, or inside an
* ellipse defined by the neighbor focal points to be more precise.
* Return TRUE if a corner is flat or nearly flat. This is equivalent to
* saying that the corner point is close to its neighbors, or inside an
* ellipse defined by the neighbor focal points to be more precise.
*/
FT_BASE( FT_Int )
ft_corner_is_flat( FT_Pos in_x,
@ -337,10 +354,11 @@ FT_BEGIN_HEADER
/*
* Return the most significant bit index.
* Return the most significant bit index.
*/
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
#if defined( __GNUC__ ) && \
( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
@ -352,9 +370,34 @@ FT_BEGIN_HEADER
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
#endif /* __GNUC__ */
#elif defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
#if FT_SIZEOF_INT == 4
#include <intrin.h>
#pragma intrinsic( _BitScanReverse )
static __inline FT_Int32
FT_MSB_i386( FT_UInt32 x )
{
unsigned long where;
_BitScanReverse( &where, x );
return (FT_Int32)where;
}
#define FT_MSB( x ) ( FT_MSB_i386( x ) )
#endif
#endif /* __GNUC__ */
#endif /* _MSC_VER */
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
#ifndef FT_MSB
@ -366,8 +409,8 @@ FT_BEGIN_HEADER
/*
* Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
* two fixed-point arguments instead.
* Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
* two fixed-point arguments instead.
*/
FT_BASE( FT_Fixed )
FT_Hypot( FT_Fixed x,
@ -376,23 +419,24 @@ FT_BEGIN_HEADER
#if 0
/*************************************************************************/
/* */
/* <Function> */
/* FT_SqrtFixed */
/* */
/* <Description> */
/* Computes the square root of a 16.16 fixed-point value. */
/* */
/* <Input> */
/* x :: The value to compute the root for. */
/* */
/* <Return> */
/* The result of `sqrt(x)'. */
/* */
/* <Note> */
/* This function is not very fast. */
/* */
/**************************************************************************
*
* @function:
* FT_SqrtFixed
*
* @description:
* Computes the square root of a 16.16 fixed-point value.
*
* @input:
* x ::
* The value to compute the root for.
*
* @return:
* The result of 'sqrt(x)'.
*
* @note:
* This function is not very fast.
*/
FT_BASE( FT_Int32 )
FT_SqrtFixed( FT_Int32 x );
@ -409,14 +453,23 @@ FT_BEGIN_HEADER
: ( -( ( 32 - (x) ) & -64 ) ) )
/*
* The following macros have two purposes.
* The following macros have two purposes.
*
* . Tag places where overflow is expected and harmless.
* - Tag places where overflow is expected and harmless.
*
* . Avoid run-time sanitizer errors.
* - Avoid run-time sanitizer errors.
*
* Use with care!
* Use with care!
*/
#define ADD_INT( a, b ) \
(FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) )
#define SUB_INT( a, b ) \
(FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) )
#define MUL_INT( a, b ) \
(FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) )
#define NEG_INT( a ) \
(FT_Int)( (FT_UInt)0 - (FT_UInt)(a) )
#define ADD_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
#define SUB_LONG( a, b ) \
@ -435,6 +488,19 @@ FT_BEGIN_HEADER
#define NEG_INT32( a ) \
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
#ifdef FT_LONG64
#define ADD_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
#define SUB_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) - (FT_UInt64)(b) )
#define MUL_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) * (FT_UInt64)(b) )
#define NEG_INT64( a ) \
(FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
#endif /* FT_LONG64 */
FT_END_HEADER

View File

@ -1,24 +1,24 @@
/***************************************************************************/
/* */
/* ftdebug.h */
/* */
/* Debugging and logging component (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/* */
/* IMPORTANT: A description of FreeType's debugging support can be */
/* found in `docs/DEBUG.TXT'. Read it if you need to use or */
/* understand this code. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftdebug.h
*
* Debugging and logging component (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*
* IMPORTANT: A description of FreeType's debugging support can be
* found in 'docs/DEBUG.TXT'. Read it if you need to use or
* understand this code.
*
*/
#ifndef FTDEBUG_H_
@ -42,12 +42,12 @@ FT_BEGIN_HEADER
#endif
/*************************************************************************/
/* */
/* Define the trace enums as well as the trace levels array when they */
/* are needed. */
/* */
/*************************************************************************/
/**************************************************************************
*
* Define the trace enums as well as the trace levels array when they are
* needed.
*
*/
#ifdef FT_DEBUG_LEVEL_TRACE
@ -62,32 +62,37 @@ FT_BEGIN_HEADER
} FT_Trace;
/* defining the array of trace levels, provided by `src/base/ftdebug.c' */
extern int ft_trace_levels[trace_count];
/* a pointer to the array of trace levels, */
/* provided by `src/base/ftdebug.c' */
extern int* ft_trace_levels;
#undef FT_TRACE_DEF
#endif /* FT_DEBUG_LEVEL_TRACE */
/*************************************************************************/
/* */
/* Define the FT_TRACE macro */
/* */
/* IMPORTANT! */
/* */
/* Each component must define the macro FT_COMPONENT to a valid FT_Trace */
/* value before using any TRACE macro. */
/* */
/*************************************************************************/
/**************************************************************************
*
* Define the FT_TRACE macro
*
* IMPORTANT!
*
* Each component must define the macro FT_COMPONENT to a valid FT_Trace
* value before using any TRACE macro.
*
*/
#ifdef FT_DEBUG_LEVEL_TRACE
#define FT_TRACE( level, varformat ) \
do \
{ \
if ( ft_trace_levels[FT_COMPONENT] >= level ) \
FT_Message varformat; \
/* we need two macros here to make cpp expand `FT_COMPONENT' */
#define FT_TRACE_COMP( x ) FT_TRACE_COMP_( x )
#define FT_TRACE_COMP_( x ) trace_ ## x
#define FT_TRACE( level, varformat ) \
do \
{ \
if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
FT_Message varformat; \
} while ( 0 )
#else /* !FT_DEBUG_LEVEL_TRACE */
@ -97,62 +102,85 @@ FT_BEGIN_HEADER
#endif /* !FT_DEBUG_LEVEL_TRACE */
/*************************************************************************/
/* */
/* <Function> */
/* FT_Trace_Get_Count */
/* */
/* <Description> */
/* Return the number of available trace components. */
/* */
/* <Return> */
/* The number of trace components. 0 if FreeType 2 is not built with */
/* FT_DEBUG_LEVEL_TRACE definition. */
/* */
/* <Note> */
/* This function may be useful if you want to access elements of */
/* the internal `ft_trace_levels' array by an index. */
/* */
/**************************************************************************
*
* @function:
* FT_Trace_Get_Count
*
* @description:
* Return the number of available trace components.
*
* @return:
* The number of trace components. 0 if FreeType 2 is not built with
* FT_DEBUG_LEVEL_TRACE definition.
*
* @note:
* This function may be useful if you want to access elements of the
* internal trace levels array by an index.
*/
FT_BASE( FT_Int )
FT_Trace_Get_Count( void );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Trace_Get_Name */
/* */
/* <Description> */
/* Return the name of a trace component. */
/* */
/* <Input> */
/* The index of the trace component. */
/* */
/* <Return> */
/* The name of the trace component. This is a statically allocated */
/* C string, so do not free it after use. NULL if FreeType 2 is not */
/* built with FT_DEBUG_LEVEL_TRACE definition. */
/* */
/* <Note> */
/* Use @FT_Trace_Get_Count to get the number of available trace */
/* components. */
/* */
/* This function may be useful if you want to control FreeType 2's */
/* debug level in your application. */
/* */
/**************************************************************************
*
* @function:
* FT_Trace_Get_Name
*
* @description:
* Return the name of a trace component.
*
* @input:
* The index of the trace component.
*
* @return:
* The name of the trace component. This is a statically allocated
* C~string, so do not free it after use. `NULL` if FreeType is not
* built with FT_DEBUG_LEVEL_TRACE definition.
*
* @note:
* Use @FT_Trace_Get_Count to get the number of available trace
* components.
*/
FT_BASE( const char* )
FT_Trace_Get_Name( FT_Int idx );
/*************************************************************************/
/* */
/* You need two opening and closing parentheses! */
/* */
/* Example: FT_TRACE0(( "Value is %i", foo )) */
/* */
/* Output of the FT_TRACEX macros is sent to stderr. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @function:
* FT_Trace_Disable
*
* @description:
* Switch off tracing temporarily. It can be activated again with
* @FT_Trace_Enable.
*/
FT_BASE( void )
FT_Trace_Disable( void );
/**************************************************************************
*
* @function:
* FT_Trace_Enable
*
* @description:
* Activate tracing. Use it after tracing has been switched off with
* @FT_Trace_Disable.
*/
FT_BASE( void )
FT_Trace_Enable( void );
/**************************************************************************
*
* You need two opening and closing parentheses!
*
* Example: FT_TRACE0(( "Value is %i", foo ))
*
* Output of the FT_TRACEX macros is sent to stderr.
*
*/
#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
@ -164,13 +192,13 @@ FT_BEGIN_HEADER
#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
/*************************************************************************/
/* */
/* Define the FT_ERROR macro. */
/* */
/* Output of this macro is sent to stderr. */
/* */
/*************************************************************************/
/**************************************************************************
*
* Define the FT_ERROR macro.
*
* Output of this macro is sent to stderr.
*
*/
#ifdef FT_DEBUG_LEVEL_ERROR
@ -183,12 +211,12 @@ FT_BEGIN_HEADER
#endif /* !FT_DEBUG_LEVEL_ERROR */
/*************************************************************************/
/* */
/* Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw' */
/* makes it possible to easily set a breakpoint at this function. */
/* */
/*************************************************************************/
/**************************************************************************
*
* Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw` makes
* it possible to easily set a breakpoint at this function.
*
*/
#ifdef FT_DEBUG_LEVEL_ERROR
@ -215,11 +243,11 @@ FT_BEGIN_HEADER
#endif /* !FT_DEBUG_LEVEL_ERROR */
/*************************************************************************/
/* */
/* Define `FT_Message' and `FT_Panic' when needed. */
/* */
/*************************************************************************/
/**************************************************************************
*
* Define `FT_Message` and `FT_Panic` when needed.
*
*/
#ifdef FT_DEBUG_LEVEL_ERROR

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftdrv.h */
/* */
/* FreeType internal font driver interface (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftdrv.h
*
* FreeType internal font driver interface (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTDRV_H_
@ -87,73 +87,80 @@ FT_BEGIN_HEADER
FT_Fixed* advances );
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Driver_ClassRec */
/* */
/* <Description> */
/* The font driver class. This structure mostly contains pointers to */
/* driver methods. */
/* */
/* <Fields> */
/* root :: The parent module. */
/* */
/* face_object_size :: The size of a face object in bytes. */
/* */
/* size_object_size :: The size of a size object in bytes. */
/* */
/* slot_object_size :: The size of a glyph object in bytes. */
/* */
/* init_face :: The format-specific face constructor. */
/* */
/* done_face :: The format-specific face destructor. */
/* */
/* init_size :: The format-specific size constructor. */
/* */
/* done_size :: The format-specific size destructor. */
/* */
/* init_slot :: The format-specific slot constructor. */
/* */
/* done_slot :: The format-specific slot destructor. */
/* */
/* */
/* load_glyph :: A function handle to load a glyph to a slot. */
/* This field is mandatory! */
/* */
/* get_kerning :: A function handle to return the unscaled */
/* kerning for a given pair of glyphs. Can be */
/* set to 0 if the format doesn't support */
/* kerning. */
/* */
/* attach_file :: This function handle is used to read */
/* additional data for a face from another */
/* file/stream. For example, this can be used to */
/* add data from AFM or PFM files on a Type 1 */
/* face, or a CIDMap on a CID-keyed face. */
/* */
/* get_advances :: A function handle used to return advance */
/* widths of `count' glyphs (in font units), */
/* starting at `first'. The `vertical' flag must */
/* be set to get vertical advance heights. The */
/* `advances' buffer is caller-allocated. */
/* The idea of this function is to be able to */
/* perform device-independent text layout without */
/* loading a single glyph image. */
/* */
/* request_size :: A handle to a function used to request the new */
/* character size. Can be set to 0 if the */
/* scaling done in the base layer suffices. */
/* */
/* select_size :: A handle to a function used to select a new */
/* fixed size. It is used only if */
/* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
/* to 0 if the scaling done in the base layer */
/* suffices. */
/* <Note> */
/* Most function pointers, with the exception of `load_glyph', can be */
/* set to 0 to indicate a default behaviour. */
/* */
/**************************************************************************
*
* @struct:
* FT_Driver_ClassRec
*
* @description:
* The font driver class. This structure mostly contains pointers to
* driver methods.
*
* @fields:
* root ::
* The parent module.
*
* face_object_size ::
* The size of a face object in bytes.
*
* size_object_size ::
* The size of a size object in bytes.
*
* slot_object_size ::
* The size of a glyph object in bytes.
*
* init_face ::
* The format-specific face constructor.
*
* done_face ::
* The format-specific face destructor.
*
* init_size ::
* The format-specific size constructor.
*
* done_size ::
* The format-specific size destructor.
*
* init_slot ::
* The format-specific slot constructor.
*
* done_slot ::
* The format-specific slot destructor.
*
*
* load_glyph ::
* A function handle to load a glyph to a slot. This field is
* mandatory!
*
* get_kerning ::
* A function handle to return the unscaled kerning for a given pair of
* glyphs. Can be set to 0 if the format doesn't support kerning.
*
* attach_file ::
* This function handle is used to read additional data for a face from
* another file/stream. For example, this can be used to add data from
* AFM or PFM files on a Type 1 face, or a CIDMap on a CID-keyed face.
*
* get_advances ::
* A function handle used to return advance widths of 'count' glyphs
* (in font units), starting at 'first'. The 'vertical' flag must be
* set to get vertical advance heights. The 'advances' buffer is
* caller-allocated. The idea of this function is to be able to
* perform device-independent text layout without loading a single
* glyph image.
*
* request_size ::
* A handle to a function used to request the new character size. Can
* be set to 0 if the scaling done in the base layer suffices.
*
* select_size ::
* A handle to a function used to select a new fixed size. It is used
* only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the
* scaling done in the base layer suffices.
* @note:
* Most function pointers, with the exception of `load_glyph`, can be set
* to 0 to indicate a default behaviour.
*/
typedef struct FT_Driver_ClassRec_
{
FT_Module_Class root;
@ -184,45 +191,28 @@ FT_BEGIN_HEADER
} FT_Driver_ClassRec, *FT_Driver_Class;
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DECLARE_DRIVER */
/* */
/* <Description> */
/* Used to create a forward declaration of an FT_Driver_ClassRec */
/* struct instance. */
/* */
/* <Macro> */
/* FT_DEFINE_DRIVER */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Driver_ClassRec struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */
/* called with a pointer where the allocated structure is returned. */
/* And when it is no longer needed a `destroy' function needs to be */
/* called to release that allocation. */
/* */
/* `ftinit.c' (ft_create_default_module_classes) already contains a */
/* mechanism to call these functions for the default modules */
/* described in `ftmodule.h'. */
/* */
/* Notice that the created `create' and `destroy' functions call */
/* `pic_init' and `pic_free' to allow you to manually allocate and */
/* initialize any additional global data, like a module specific */
/* interface, and put them in the global pic container defined in */
/* `ftpic.h'. If you don't need them just implement the functions as */
/* empty to resolve the link error. Also the `pic_init' and */
/* `pic_free' functions should be declared in `pic.h', to be referred */
/* by driver definition calling `FT_DEFINE_DRIVER' in following. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro is */
/* used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
/**************************************************************************
*
* @macro:
* FT_DECLARE_DRIVER
*
* @description:
* Used to create a forward declaration of an FT_Driver_ClassRec struct
* instance.
*
* @macro:
* FT_DEFINE_DRIVER
*
* @description:
* Used to initialize an instance of FT_Driver_ClassRec struct.
*
* `ftinit.c` (ft_create_default_module_classes) already contains a
* mechanism to call these functions for the default modules described in
* `ftmodule.h`.
*
* The struct will be allocated in the global scope (or the scope where
* the macro is used).
*/
#define FT_DECLARE_DRIVER( class_ ) \
FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_;
@ -289,108 +279,6 @@ FT_BEGIN_HEADER
select_size_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
#define FT_DEFINE_DRIVER( \
class_, \
flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_, \
face_object_size_, \
size_object_size_, \
slot_object_size_, \
init_face_, \
done_face_, \
init_size_, \
done_size_, \
init_slot_, \
done_slot_, \
load_glyph_, \
get_kerning_, \
attach_file_, \
get_advances_, \
request_size_, \
select_size_ ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_Module_Class* clazz ) \
{ \
FT_Memory memory = library->memory; \
FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
\
\
class_ ## _pic_free( library ); \
if ( dclazz ) \
FT_FREE( dclazz ); \
} \
\
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_Module_Class** output_class ) \
{ \
FT_Driver_Class clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
return error; \
\
error = class_ ## _pic_init( library ); \
if ( error ) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
FT_DEFINE_ROOT_MODULE( flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_ ) \
\
clazz->face_object_size = face_object_size_; \
clazz->size_object_size = size_object_size_; \
clazz->slot_object_size = slot_object_size_; \
\
clazz->init_face = init_face_; \
clazz->done_face = done_face_; \
\
clazz->init_size = init_size_; \
clazz->done_size = done_size_; \
\
clazz->init_slot = init_slot_; \
clazz->done_slot = done_slot_; \
\
clazz->load_glyph = load_glyph_; \
\
clazz->get_kerning = get_kerning_; \
clazz->attach_file = attach_file_; \
clazz->get_advances = get_advances_; \
\
clazz->request_size = request_size_; \
clazz->select_size = select_size_; \
\
*output_class = (FT_Module_Class*)clazz; \
\
return FT_Err_Ok; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftgloadr.h */
/* */
/* The FreeType glyph loader (specification). */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftgloadr.h
*
* The FreeType glyph loader (specification).
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTGLOADR_H_
@ -27,15 +27,15 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
/* FT_GlyphLoader */
/* */
/* <Description> */
/* The glyph loader is an internal object used to load several glyphs */
/* together (for example, in the case of composites). */
/* */
/**************************************************************************
*
* @struct:
* FT_GlyphLoader
*
* @description:
* The glyph loader is an internal object used to load several glyphs
* together (for example, in the case of composites).
*/
typedef struct FT_SubGlyphRec_
{
FT_Int index;
@ -138,11 +138,6 @@ FT_BEGIN_HEADER
FT_BASE( void )
FT_GlyphLoader_Add( FT_GlyphLoader loader );
/* copy points from one glyph loader to another */
FT_BASE( FT_Error )
FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
FT_GlyphLoader source );
/* */

View File

@ -1,10 +1,10 @@
/***************************************************************************/
/* */
/* fthash.h */
/* */
/* Hashing functions (specification). */
/* */
/***************************************************************************/
/****************************************************************************
*
* fthash.h
*
* Hashing functions (specification).
*
*/
/*
* Copyright 2000 Computing Research Labs, New Mexico State University
@ -30,13 +30,13 @@
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*************************************************************************/
/* */
/* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50 */
/* */
/* taken from Mark Leisher's xmbdfed package */
/* */
/*************************************************************************/
/**************************************************************************
*
* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50
*
* taken from Mark Leisher's xmbdfed package
*
*/
#ifndef FTHASH_H_

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftmemory.h */
/* */
/* The FreeType memory management macros (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftmemory.h
*
* The FreeType memory management macros (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTMEMORY_H_
@ -28,16 +28,16 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Macro> */
/* FT_SET_ERROR */
/* */
/* <Description> */
/* This macro is used to set an implicit `error' variable to a given */
/* expression's value (usually a function call), and convert it to a */
/* boolean which is set whenever the value is != 0. */
/* */
/**************************************************************************
*
* @macro:
* FT_SET_ERROR
*
* @description:
* This macro is used to set an implicit 'error' variable to a given
* expression's value (usually a function call), and convert it to a
* boolean which is set whenever the value is != 0.
*/
#undef FT_SET_ERROR
#define FT_SET_ERROR( expression ) \
( ( error = (expression) ) != 0 )
@ -58,9 +58,9 @@ FT_BEGIN_HEADER
/*
* C++ refuses to handle statements like p = (void*)anything, with `p' a
* typed pointer. Since we don't have a `typeof' operator in standard
* C++, we have to use a template to emulate it.
* C++ refuses to handle statements like p = (void*)anything, with `p' a
* typed pointer. Since we don't have a `typeof' operator in standard C++,
* we have to use a template to emulate it.
*/
#ifdef __cplusplus
@ -107,8 +107,8 @@ extern "C++"
/*
* The allocation functions return a pointer, and the error code
* is written to through the `p_error' parameter.
* The allocation functions return a pointer, and the error code is written
* to through the `p_error' parameter.
*/
/* The `q' variants of the functions below (`q' for `quick') don't fill */
@ -253,20 +253,19 @@ extern "C++"
/*
* Return the maximum number of addressable elements in an array.
* We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid
* any problems.
* Return the maximum number of addressable elements in an array. We limit
* ourselves to INT_MAX, rather than UINT_MAX, to avoid any problems.
*/
#define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) )
#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
/*************************************************************************/
/* */
/* The following functions macros expect that their pointer argument is */
/* _typed_ in order to automatically compute array element sizes. */
/* */
/**************************************************************************
*
* The following functions macros expect that their pointer argument is
* _typed_ in order to automatically compute array element sizes.
*/
#define FT_MEM_NEW_ARRAY( ptr, count ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftpsprop.h */
/* */
/* Get and set properties of PostScript drivers (specification). */
/* */
/* Copyright 2017-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftpsprop.h
*
* Get and set properties of PostScript drivers (specification).
*
* Copyright (C) 2017-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTPSPROP_H_

View File

@ -1,24 +1,24 @@
/***************************************************************************/
/* */
/* ftrfork.h */
/* */
/* Embedded resource forks accessor (specification). */
/* */
/* Copyright 2004-2018 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftrfork.h
*
* Embedded resource forks accessor (specification).
*
* Copyright (C) 2004-2019 by
* Masatake YAMATO and Redhat K.K.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/***************************************************************************/
/* Development of the code in this file is support of */
/* Information-technology Promotion Agency, Japan. */
/***************************************************************************/
/****************************************************************************
* Development of the code in this file is support of
* Information-technology Promotion Agency, Japan.
*/
#ifndef FTRFORK_H_
@ -72,85 +72,65 @@ FT_BEGIN_HEADER
} FT_RFork_Rule;
/* For fast translation between rule index and rule type,
* the macros FT_RFORK_xxx should be kept consistent with
* the raccess_guess_funcs table
* the macros FT_RFORK_xxx should be kept consistent with the
* raccess_guess_funcs table
*/
typedef struct ft_raccess_guess_rec_ {
ft_raccess_guess_func func;
FT_RFork_Rule type;
} ft_raccess_guess_rec;
#ifndef FT_CONFIG_OPTION_PIC
/* this array is a storage in non-PIC mode, so ; is needed in END */
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
static const type name[] = {
#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
{ raccess_guess_ ## func_suffix, \
FT_RFork_Rule_ ## type_suffix },
/* this array is a storage, thus a final `;' is needed */
#define CONST_FT_RFORK_RULE_ARRAY_END };
#else /* FT_CONFIG_OPTION_PIC */
/* this array is a function in PIC mode, so no ; is needed in END */
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
void \
FT_Init_Table_ ## name( type* storage ) \
{ \
type* local = storage; \
\
\
int i = 0;
#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
local[i].func = raccess_guess_ ## func_suffix; \
local[i].type = FT_RFork_Rule_ ## type_suffix; \
i++;
#define CONST_FT_RFORK_RULE_ARRAY_END }
#endif /* FT_CONFIG_OPTION_PIC */
#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
/*************************************************************************/
/* */
/* <Function> */
/* FT_Raccess_Guess */
/* */
/* <Description> */
/* Guess a file name and offset where the actual resource fork is */
/* stored. The macro FT_RACCESS_N_RULES holds the number of */
/* guessing rules; the guessed result for the Nth rule is */
/* represented as a triplet: a new file name (new_names[N]), a file */
/* offset (offsets[N]), and an error code (errors[N]). */
/* */
/* <Input> */
/* library :: */
/* A FreeType library instance. */
/* */
/* stream :: */
/* A file stream containing the resource fork. */
/* */
/* base_name :: */
/* The (base) file name of the resource fork used for some */
/* guessing rules. */
/* */
/* <Output> */
/* new_names :: */
/* An array of guessed file names in which the resource forks may */
/* exist. If `new_names[N]' is NULL, the guessed file name is */
/* equal to `base_name'. */
/* */
/* offsets :: */
/* An array of guessed file offsets. `offsets[N]' holds the file */
/* offset of the possible start of the resource fork in file */
/* `new_names[N]'. */
/* */
/* errors :: */
/* An array of FreeType error codes. `errors[N]' is the error */
/* code of Nth guessing rule function. If `errors[N]' is not */
/* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */
/* */
/**************************************************************************
*
* @function:
* FT_Raccess_Guess
*
* @description:
* Guess a file name and offset where the actual resource fork is stored.
* The macro FT_RACCESS_N_RULES holds the number of guessing rules; the
* guessed result for the Nth rule is represented as a triplet: a new
* file name (new_names[N]), a file offset (offsets[N]), and an error
* code (errors[N]).
*
* @input:
* library ::
* A FreeType library instance.
*
* stream ::
* A file stream containing the resource fork.
*
* base_name ::
* The (base) file name of the resource fork used for some guessing
* rules.
*
* @output:
* new_names ::
* An array of guessed file names in which the resource forks may
* exist. If 'new_names[N]' is `NULL`, the guessed file name is equal
* to `base_name`.
*
* offsets ::
* An array of guessed file offsets. 'offsets[N]' holds the file
* offset of the possible start of the resource fork in file
* 'new_names[N]'.
*
* errors ::
* An array of FreeType error codes. 'errors[N]' is the error code of
* Nth guessing rule function. If 'errors[N]' is not FT_Err_Ok,
* 'new_names[N]' and 'offsets[N]' are meaningless.
*/
FT_BASE( void )
FT_Raccess_Guess( FT_Library library,
FT_Stream stream,
@ -160,37 +140,37 @@ FT_BEGIN_HEADER
FT_Error* errors );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Raccess_Get_HeaderInfo */
/* */
/* <Description> */
/* Get the information from the header of resource fork. The */
/* information includes the file offset where the resource map */
/* starts, and the file offset where the resource data starts. */
/* `FT_Raccess_Get_DataOffsets' requires these two data. */
/* */
/* <Input> */
/* library :: */
/* A FreeType library instance. */
/* */
/* stream :: */
/* A file stream containing the resource fork. */
/* */
/* rfork_offset :: */
/* The file offset where the resource fork starts. */
/* */
/* <Output> */
/* map_offset :: */
/* The file offset where the resource map starts. */
/* */
/* rdata_pos :: */
/* The file offset where the resource data starts. */
/* */
/* <Return> */
/* FreeType error code. FT_Err_Ok means success. */
/* */
/**************************************************************************
*
* @function:
* FT_Raccess_Get_HeaderInfo
*
* @description:
* Get the information from the header of resource fork. The information
* includes the file offset where the resource map starts, and the file
* offset where the resource data starts. `FT_Raccess_Get_DataOffsets`
* requires these two data.
*
* @input:
* library ::
* A FreeType library instance.
*
* stream ::
* A file stream containing the resource fork.
*
* rfork_offset ::
* The file offset where the resource fork starts.
*
* @output:
* map_offset ::
* The file offset where the resource map starts.
*
* rdata_pos ::
* The file offset where the resource data starts.
*
* @return:
* FreeType error code. FT_Err_Ok means success.
*/
FT_BASE( FT_Error )
FT_Raccess_Get_HeaderInfo( FT_Library library,
FT_Stream stream,
@ -199,55 +179,54 @@ FT_BEGIN_HEADER
FT_Long *rdata_pos );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Raccess_Get_DataOffsets */
/* */
/* <Description> */
/* Get the data offsets for a tag in a resource fork. Offsets are */
/* stored in an array because, in some cases, resources in a resource */
/* fork have the same tag. */
/* */
/* <Input> */
/* library :: */
/* A FreeType library instance. */
/* */
/* stream :: */
/* A file stream containing the resource fork. */
/* */
/* map_offset :: */
/* The file offset where the resource map starts. */
/* */
/* rdata_pos :: */
/* The file offset where the resource data starts. */
/* */
/* tag :: */
/* The resource tag. */
/* */
/* sort_by_res_id :: */
/* A Boolean to sort the fragmented resource by their ids. */
/* The fragmented resources for `POST' resource should be sorted */
/* to restore Type1 font properly. For `sfnt' resources, sorting */
/* may induce a different order of the faces in comparison to that */
/* by QuickDraw API. */
/* */
/* <Output> */
/* offsets :: */
/* The stream offsets for the resource data specified by `tag'. */
/* This array is allocated by the function, so you have to call */
/* @ft_mem_free after use. */
/* */
/* count :: */
/* The length of offsets array. */
/* */
/* <Return> */
/* FreeType error code. FT_Err_Ok means success. */
/* */
/* <Note> */
/* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */
/* value for `map_offset' and `rdata_pos'. */
/* */
/**************************************************************************
*
* @function:
* FT_Raccess_Get_DataOffsets
*
* @description:
* Get the data offsets for a tag in a resource fork. Offsets are stored
* in an array because, in some cases, resources in a resource fork have
* the same tag.
*
* @input:
* library ::
* A FreeType library instance.
*
* stream ::
* A file stream containing the resource fork.
*
* map_offset ::
* The file offset where the resource map starts.
*
* rdata_pos ::
* The file offset where the resource data starts.
*
* tag ::
* The resource tag.
*
* sort_by_res_id ::
* A Boolean to sort the fragmented resource by their ids. The
* fragmented resources for 'POST' resource should be sorted to restore
* Type1 font properly. For 'sfnt' resources, sorting may induce a
* different order of the faces in comparison to that by QuickDraw API.
*
* @output:
* offsets ::
* The stream offsets for the resource data specified by 'tag'. This
* array is allocated by the function, so you have to call @ft_mem_free
* after use.
*
* count ::
* The length of offsets array.
*
* @return:
* FreeType error code. FT_Err_Ok means success.
*
* @note:
* Normally you should use `FT_Raccess_Get_HeaderInfo` to get the value
* for `map_offset` and `rdata_pos`.
*/
FT_BASE( FT_Error )
FT_Raccess_Get_DataOffsets( FT_Library library,
FT_Stream stream,

View File

@ -1,31 +1,31 @@
/***************************************************************************/
/* */
/* ftserv.h */
/* */
/* The FreeType services (specification only). */
/* */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftserv.h
*
* The FreeType services (specification only).
*
* Copyright (C) 2003-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* Each module can export one or more `services'. Each service is */
/* identified by a constant string and modeled by a pointer; the latter */
/* generally corresponds to a structure containing function pointers. */
/* */
/* Note that a service's data cannot be a mere function pointer because */
/* in C it is possible that function pointers might be implemented */
/* differently than data pointers (e.g. 48 bits instead of 32). */
/* */
/*************************************************************************/
/**************************************************************************
*
* Each module can export one or more 'services'. Each service is
* identified by a constant string and modeled by a pointer; the latter
* generally corresponds to a structure containing function pointers.
*
* Note that a service's data cannot be a mere function pointer because in
* C it is possible that function pointers might be implemented differently
* than data pointers (e.g. 48 bits instead of 32).
*
*/
#ifndef FTSERV_H_
@ -34,7 +34,8 @@
FT_BEGIN_HEADER
/*
/**************************************************************************
*
* @macro:
* FT_FACE_FIND_SERVICE
*
@ -46,15 +47,15 @@ FT_BEGIN_HEADER
* The source face handle.
*
* id ::
* A string describing the service as defined in the service's
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* `multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_'.
* A string describing the service as defined in the service's header
* files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* 'multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_`.
*
* @output:
* ptr ::
* A variable that receives the service pointer. Will be NULL
* if not found.
* A variable that receives the service pointer. Will be `NULL` if not
* found.
*/
#ifdef __cplusplus
@ -85,7 +86,8 @@ FT_BEGIN_HEADER
#endif /* !C++ */
/*
/**************************************************************************
*
* @macro:
* FT_FACE_FIND_GLOBAL_SERVICE
*
@ -97,15 +99,15 @@ FT_BEGIN_HEADER
* The source face handle.
*
* id ::
* A string describing the service as defined in the service's
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* `multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_'.
* A string describing the service as defined in the service's header
* files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* 'multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_`.
*
* @output:
* ptr ::
* A variable that receives the service pointer. Will be NULL
* if not found.
* A variable that receives the service pointer. Will be `NULL` if not
* found.
*/
#ifdef __cplusplus
@ -144,8 +146,8 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*
* The following structure is used to _describe_ a given service
* to the library. This is useful to build simple static service lists.
* The following structure is used to _describe_ a given service to the
* library. This is useful to build simple static service lists.
*/
typedef struct FT_ServiceDescRec_
{
@ -157,35 +159,26 @@ FT_BEGIN_HEADER
typedef const FT_ServiceDescRec* FT_ServiceDesc;
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DEFINE_SERVICEDESCREC1 */
/* FT_DEFINE_SERVICEDESCREC2 */
/* FT_DEFINE_SERVICEDESCREC3 */
/* FT_DEFINE_SERVICEDESCREC4 */
/* FT_DEFINE_SERVICEDESCREC5 */
/* FT_DEFINE_SERVICEDESCREC6 */
/* FT_DEFINE_SERVICEDESCREC7 */
/* FT_DEFINE_SERVICEDESCREC8 */
/* */
/* <Description> */
/* Used to initialize an array of FT_ServiceDescRec structures. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function needs to */
/* be called with a pointer to return an allocated array. As soon as */
/* it is no longer needed, a `destroy' function needs to be called to */
/* release that allocation. */
/* */
/* These functions should be manually called from the `pic_init' and */
/* `pic_free' functions of your module (see FT_DEFINE_MODULE). */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the array will be */
/* allocated in the global scope (or the scope where the macro is */
/* used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
/**************************************************************************
*
* @macro:
* FT_DEFINE_SERVICEDESCREC1
* FT_DEFINE_SERVICEDESCREC2
* FT_DEFINE_SERVICEDESCREC3
* FT_DEFINE_SERVICEDESCREC4
* FT_DEFINE_SERVICEDESCREC5
* FT_DEFINE_SERVICEDESCREC6
* FT_DEFINE_SERVICEDESCREC7
* FT_DEFINE_SERVICEDESCREC8
* FT_DEFINE_SERVICEDESCREC9
* FT_DEFINE_SERVICEDESCREC10
*
* @description:
* Used to initialize an array of FT_ServiceDescRec structures.
*
* The array will be allocated in the global scope (or the scope where
* the macro is used).
*/
#define FT_DEFINE_SERVICEDESCREC1( class_, \
serv_id_1, serv_data_1 ) \
static const FT_ServiceDescRec class_[] = \
@ -356,504 +349,15 @@ FT_BEGIN_HEADER
{ NULL, NULL } \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICEDESCREC1( class_, \
serv_id_1, serv_data_1 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = NULL; \
clazz[1].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC2( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = NULL; \
clazz[2].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC3( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = NULL; \
clazz[3].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC4( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = NULL; \
clazz[4].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC5( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = NULL; \
clazz[5].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC6( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = NULL; \
clazz[6].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC7( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = serv_id_7; \
clazz[6].serv_data = serv_data_7; \
clazz[7].serv_id = NULL; \
clazz[7].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC8( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 9 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = serv_id_7; \
clazz[6].serv_data = serv_data_7; \
clazz[7].serv_id = serv_id_8; \
clazz[7].serv_data = serv_data_8; \
clazz[8].serv_id = NULL; \
clazz[8].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC9( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 10 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = serv_id_7; \
clazz[6].serv_data = serv_data_7; \
clazz[7].serv_id = serv_id_8; \
clazz[7].serv_data = serv_data_8; \
clazz[8].serv_id = serv_id_9; \
clazz[8].serv_data = serv_data_9; \
clazz[9].serv_id = NULL; \
clazz[9].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC10( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9, \
serv_id_10, serv_data_10 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 11 ) ) \
return error; \
\
clazz[ 0].serv_id = serv_id_1; \
clazz[ 0].serv_data = serv_data_1; \
clazz[ 1].serv_id = serv_id_2; \
clazz[ 1].serv_data = serv_data_2; \
clazz[ 2].serv_id = serv_id_3; \
clazz[ 2].serv_data = serv_data_3; \
clazz[ 3].serv_id = serv_id_4; \
clazz[ 3].serv_data = serv_data_4; \
clazz[ 4].serv_id = serv_id_5; \
clazz[ 4].serv_data = serv_data_5; \
clazz[ 5].serv_id = serv_id_6; \
clazz[ 5].serv_data = serv_data_6; \
clazz[ 6].serv_id = serv_id_7; \
clazz[ 6].serv_data = serv_data_7; \
clazz[ 7].serv_id = serv_id_8; \
clazz[ 7].serv_data = serv_data_8; \
clazz[ 8].serv_id = serv_id_9; \
clazz[ 8].serv_data = serv_data_9; \
clazz[ 9].serv_id = serv_id_10; \
clazz[ 9].serv_data = serv_data_10; \
clazz[10].serv_id = NULL; \
clazz[10].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/*
* Parse a list of FT_ServiceDescRec descriptors and look for
* a specific service by ID. Note that the last element in the
* array must be { NULL, NULL }, and that the function should
* return NULL if the service isn't available.
* Parse a list of FT_ServiceDescRec descriptors and look for a specific
* service by ID. Note that the last element in the array must be { NULL,
* NULL }, and that the function should return NULL if the service isn't
* available.
*
* This function can be used by modules to implement their
* `get_service' method.
* This function can be used by modules to implement their `get_service'
* method.
*/
FT_BASE( FT_Pointer )
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
@ -869,16 +373,16 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*
* This structure is used to store a cache for several frequently used
* services. It is the type of `face->internal->services'. You
* should only use FT_FACE_LOOKUP_SERVICE to access it.
* This structure is used to store a cache for several frequently used
* services. It is the type of `face->internal->services'. You should
* only use FT_FACE_LOOKUP_SERVICE to access it.
*
* All fields should have the type FT_Pointer to relax compilation
* dependencies. We assume the developer isn't completely stupid.
* All fields should have the type FT_Pointer to relax compilation
* dependencies. We assume the developer isn't completely stupid.
*
* Each field must be named `service_XXXX' where `XXX' corresponds to
* the correct FT_SERVICE_ID_XXXX macro. See the definition of
* FT_FACE_LOOKUP_SERVICE below how this is implemented.
* Each field must be named `service_XXXX' where `XXX' corresponds to the
* correct FT_SERVICE_ID_XXXX macro. See the definition of
* FT_FACE_LOOKUP_SERVICE below how this is implemented.
*
*/
typedef struct FT_ServiceCacheRec_
@ -894,14 +398,15 @@ FT_BEGIN_HEADER
/*
* A magic number used within the services cache.
* A magic number used within the services cache.
*/
/* ensure that value `1' has the same width as a pointer */
#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1)
/*
/**************************************************************************
*
* @macro:
* FT_FACE_LOOKUP_SERVICE
*
@ -910,7 +415,7 @@ FT_BEGIN_HEADER
* using its cache.
*
* @input:
* face::
* face ::
* The source face handle containing the cache.
*
* field ::
@ -921,7 +426,7 @@ FT_BEGIN_HEADER
*
* @output:
* ptr ::
* A variable receiving the service data. NULL if not available.
* A variable receiving the service data. `NULL` if not available.
*/
#ifdef __cplusplus
@ -969,7 +474,7 @@ FT_BEGIN_HEADER
#endif /* !C++ */
/*
* A macro used to define new service structure types.
* A macro used to define new service structure types.
*/
#define FT_DEFINE_SERVICE( name ) \
@ -982,7 +487,7 @@ FT_BEGIN_HEADER
/* */
/*
* The header files containing the services.
* The header files containing the services.
*/
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftstream.h */
/* */
/* Stream handling (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftstream.h
*
* Stream handling (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTSTREAM_H_
@ -96,13 +96,13 @@ FT_BEGIN_HEADER
/* The structure type must be set in the FT_STRUCTURE macro before */
/* calling the FT_FRAME_START() macro. */
/* */
#define FT_FIELD_SIZE( f ) \
#define FT_FIELD_SIZE( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
#define FT_FIELD_SIZE_DELTA( f ) \
#define FT_FIELD_SIZE_DELTA( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
#define FT_FIELD_OFFSET( f ) \
#define FT_FIELD_OFFSET( f ) \
(FT_UShort)( offsetof( FT_STRUCTURE, f ) )
#define FT_FRAME_FIELD( frame_op, field ) \
@ -147,11 +147,11 @@ FT_BEGIN_HEADER
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
/*************************************************************************/
/* */
/* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */
/* type `char*' or equivalent (1-byte elements). */
/* */
/**************************************************************************
*
* Integer extraction macros -- the 'buffer' parameter must ALWAYS be of
* type 'char*' or equivalent (1-byte elements).
*/
#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
@ -165,6 +165,21 @@ FT_BEGIN_HEADER
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
/*
* function acts on increases does range for emits
* pointer checking frames error
* -------------------------------------------------------------------
* FT_PEEK_XXX buffer pointer no no no no
* FT_NEXT_XXX buffer pointer yes no no no
* FT_GET_XXX stream->cursor yes yes yes no
* FT_READ_XXX stream->pos yes yes no yes
*/
/*
* `FT_PEEK_XXX' are generic macros to get data from a buffer position. No
* safety checks are performed.
*/
#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) )
@ -213,7 +228,10 @@ FT_BEGIN_HEADER
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
/*
* `FT_NEXT_XXX' are generic macros to get data from a buffer position
* which is then increased appropriately. No safety checks are performed.
*/
#define FT_NEXT_CHAR( buffer ) \
( (signed char)*buffer++ )
@ -258,10 +276,14 @@ FT_BEGIN_HEADER
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
/*************************************************************************/
/* */
/* Each GET_xxxx() macro uses an implicit `stream' variable. */
/* */
/**************************************************************************
*
* The `FT_GET_XXX` macros use an implicit 'stream' variable.
*
* Note that a call to `FT_STREAM_SEEK` or `FT_STREAM_POS` has **no**
* effect on `FT_GET_XXX`! They operate on `stream->pos`, while
* `FT_GET_XXX` use `stream->cursor`.
*/
#if 0
#define FT_GET_MACRO( type ) FT_NEXT_ ## type ( stream->cursor )
@ -299,10 +321,18 @@ FT_BEGIN_HEADER
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
#endif
#define FT_READ_MACRO( func, type, var ) \
( var = (type)func( stream, &error ), \
error != FT_Err_Ok )
/*
* The `FT_READ_XXX' macros use implicit `stream' and `error' variables.
*
* `FT_READ_XXX' can be controlled with `FT_STREAM_SEEK' and
* `FT_STREAM_POS'. They use the full machinery to check whether a read is
* valid.
*/
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
@ -387,12 +417,14 @@ FT_BEGIN_HEADER
/* Enter a frame of `count' consecutive bytes in a stream. Returns an */
/* error if the frame could not be read/accessed. The caller can use */
/* the FT_Stream_Get_XXX functions to retrieve frame data without */
/* the `FT_Stream_GetXXX' functions to retrieve frame data without */
/* error checks. */
/* */
/* You must _always_ call FT_Stream_ExitFrame() once you have entered */
/* You must _always_ call `FT_Stream_ExitFrame' once you have entered */
/* a stream frame! */
/* */
/* Nested frames are not permitted. */
/* */
FT_BASE( FT_Error )
FT_Stream_EnterFrame( FT_Stream stream,
FT_ULong count );
@ -401,25 +433,29 @@ FT_BEGIN_HEADER
FT_BASE( void )
FT_Stream_ExitFrame( FT_Stream stream );
/* Extract a stream frame. If the stream is disk-based, a heap block */
/* is allocated and the frame bytes are read into it. If the stream */
/* is memory-based, this function simply set a pointer to the data. */
/* is memory-based, this function simply sets a pointer to the data. */
/* */
/* Useful to optimize access to memory-based streams transparently. */
/* */
/* All extracted frames must be `freed' with a call to the function */
/* FT_Stream_ReleaseFrame(). */
/* `FT_Stream_GetXXX' functions can't be used. */
/* */
/* An extracted frame must be `freed' with a call to the function */
/* `FT_Stream_ReleaseFrame'. */
/* */
FT_BASE( FT_Error )
FT_Stream_ExtractFrame( FT_Stream stream,
FT_ULong count,
FT_Byte** pbytes );
/* release an extract frame (see FT_Stream_ExtractFrame) */
/* release an extract frame (see `FT_Stream_ExtractFrame') */
FT_BASE( void )
FT_Stream_ReleaseFrame( FT_Stream stream,
FT_Byte** pbytes );
/* read a byte from an entered frame */
FT_BASE( FT_Char )
FT_Stream_GetChar( FT_Stream stream );

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* fttrace.h */
/* */
/* Tracing handling (specification only). */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* fttrace.h
*
* Tracing handling (specification only).
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/* definitions of trace levels for FreeType 2 */
@ -23,23 +23,24 @@ FT_TRACE_DEF( any )
/* base components */
FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */
FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */
FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */
FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
FT_TRACE_DEF( init ) /* initialization (ftinit.c) */
FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */
FT_TRACE_DEF( list ) /* list management (ftlist.c) */
FT_TRACE_DEF( init ) /* initialization (ftinit.c) */
FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */
FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */
FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */
FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
FT_TRACE_DEF( bitmap ) /* bitmap manipulation (ftbitmap.c) */
FT_TRACE_DEF( checksum ) /* bitmap checksum (ftobjs.c) */
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
FT_TRACE_DEF( bitmap ) /* bitmap checksum (ftobjs.c) */
FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
/* Cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
@ -47,21 +48,24 @@ FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
/* SFNT driver components */
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
FT_TRACE_DEF( sfwoff ) /* WOFF format handler (sfwoff.c) */
FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */
FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
/* TrueType driver components */
FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */
FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */
FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */
FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */
FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */
FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
/* Type 1 driver components */
FT_TRACE_DEF( t1afm )
@ -72,14 +76,14 @@ FT_TRACE_DEF( t1objs )
FT_TRACE_DEF( t1parse )
/* PostScript helper module `psaux' */
FT_TRACE_DEF( t1decode )
FT_TRACE_DEF( cffdecode )
FT_TRACE_DEF( psobjs )
FT_TRACE_DEF( psconv )
FT_TRACE_DEF( psobjs )
FT_TRACE_DEF( t1decode )
/* PostScript hinting module `pshinter' */
FT_TRACE_DEF( pshrec )
FT_TRACE_DEF( pshalgo )
FT_TRACE_DEF( pshrec )
/* Type 2 driver components */
FT_TRACE_DEF( cffdriver )
@ -117,7 +121,6 @@ FT_TRACE_DEF( bdflib )
FT_TRACE_DEF( pfr )
/* OpenType validation components */
FT_TRACE_DEF( otvmodule )
FT_TRACE_DEF( otvcommon )
FT_TRACE_DEF( otvbase )
FT_TRACE_DEF( otvgdef )
@ -125,29 +128,30 @@ FT_TRACE_DEF( otvgpos )
FT_TRACE_DEF( otvgsub )
FT_TRACE_DEF( otvjstf )
FT_TRACE_DEF( otvmath )
FT_TRACE_DEF( otvmodule )
/* TrueTypeGX/AAT validation components */
FT_TRACE_DEF( gxvmodule )
FT_TRACE_DEF( gxvbsln )
FT_TRACE_DEF( gxvcommon )
FT_TRACE_DEF( gxvfeat )
FT_TRACE_DEF( gxvmort )
FT_TRACE_DEF( gxvmorx )
FT_TRACE_DEF( gxvbsln )
FT_TRACE_DEF( gxvjust )
FT_TRACE_DEF( gxvkern )
FT_TRACE_DEF( gxvopbd )
FT_TRACE_DEF( gxvtrak )
FT_TRACE_DEF( gxvprop )
FT_TRACE_DEF( gxvmodule )
FT_TRACE_DEF( gxvmort )
FT_TRACE_DEF( gxvmorx )
FT_TRACE_DEF( gxvlcar )
FT_TRACE_DEF( gxvopbd )
FT_TRACE_DEF( gxvprop )
FT_TRACE_DEF( gxvtrak )
/* autofit components */
FT_TRACE_DEF( afmodule )
FT_TRACE_DEF( afhints )
FT_TRACE_DEF( afcjk )
FT_TRACE_DEF( afglobal )
FT_TRACE_DEF( afhints )
FT_TRACE_DEF( afmodule )
FT_TRACE_DEF( aflatin )
FT_TRACE_DEF( aflatin2 )
FT_TRACE_DEF( afwarp )
FT_TRACE_DEF( afshaper )
FT_TRACE_DEF( afglobal )
FT_TRACE_DEF( afwarp )
/* END */

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftvalid.h */
/* */
/* FreeType validation support (specification). */
/* */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftvalid.h
*
* FreeType validation support (specification).
*
* Copyright (C) 2004-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTVALID_H_
@ -42,31 +42,31 @@ FT_BEGIN_HEADER
typedef struct FT_ValidatorRec_ volatile* FT_Validator;
/*************************************************************************/
/* */
/* There are three distinct validation levels defined here: */
/* */
/* FT_VALIDATE_DEFAULT :: */
/* A table that passes this validation level can be used reliably by */
/* FreeType. It generally means that all offsets have been checked to */
/* prevent out-of-bound reads, that array counts are correct, etc. */
/* */
/* FT_VALIDATE_TIGHT :: */
/* A table that passes this validation level can be used reliably and */
/* doesn't contain invalid data. For example, a charmap table that */
/* returns invalid glyph indices will not pass, even though it can */
/* be used with FreeType in default mode (the library will simply */
/* return an error later when trying to load the glyph). */
/* */
/* It also checks that fields which must be a multiple of 2, 4, or 8, */
/* don't have incorrect values, etc. */
/* */
/* FT_VALIDATE_PARANOID :: */
/* Only for font debugging. Checks that a table follows the */
/* specification by 100%. Very few fonts will be able to pass this */
/* level anyway but it can be useful for certain tools like font */
/* editors/converters. */
/* */
/**************************************************************************
*
* There are three distinct validation levels defined here:
*
* FT_VALIDATE_DEFAULT ::
* A table that passes this validation level can be used reliably by
* FreeType. It generally means that all offsets have been checked to
* prevent out-of-bound reads, that array counts are correct, etc.
*
* FT_VALIDATE_TIGHT ::
* A table that passes this validation level can be used reliably and
* doesn't contain invalid data. For example, a charmap table that
* returns invalid glyph indices will not pass, even though it can be
* used with FreeType in default mode (the library will simply return an
* error later when trying to load the glyph).
*
* It also checks that fields which must be a multiple of 2, 4, or 8,
* don't have incorrect values, etc.
*
* FT_VALIDATE_PARANOID ::
* Only for font debugging. Checks that a table follows the
* specification by 100%. Very few fonts will be able to pass this level
* anyway but it can be useful for certain tools like font
* editors/converters.
*/
typedef enum FT_ValidationLevel_
{
FT_VALIDATE_DEFAULT = 0,

View File

@ -1,31 +1,30 @@
/***************************************************************************/
/* */
/* internal.h */
/* */
/* Internal header files (specification only). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* internal.h
*
* Internal header files (specification only).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* This file is automatically included by `ft2build.h'. */
/* Do not include it manually! */
/* */
/*************************************************************************/
/**************************************************************************
*
* This file is automatically included by `ft2build.h`. Do not include it
* manually!
*
*/
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
#define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h>
#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
@ -41,6 +40,7 @@
#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h>
#define FT_INTERNAL_WOFF_TYPES_H <freetype/internal/wofftypes.h>
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>

View File

@ -1,20 +1,20 @@
/***************************************************************************/
/* */
/* psaux.h */
/* */
/* Auxiliary functions and data structures related to PostScript fonts */
/* (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* psaux.h
*
* Auxiliary functions and data structures related to PostScript fonts
* (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef PSAUX_H_
@ -35,10 +35,10 @@
FT_BEGIN_HEADER
/***********************************************************************/
/* */
/* PostScript modules driver class. */
/* */
/**************************************************************************
*
* PostScript modules driver class.
*/
typedef struct PS_DriverRec_
{
FT_DriverRec root;
@ -64,23 +64,27 @@ FT_BEGIN_HEADER
typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
/*************************************************************************/
/* */
/* <Struct> */
/* PS_Table_FuncsRec */
/* */
/* <Description> */
/* A set of function pointers to manage PS_Table objects. */
/* */
/* <Fields> */
/* table_init :: Used to initialize a table. */
/* */
/* table_done :: Finalizes resp. destroy a given table. */
/* */
/* table_add :: Adds a new object to a table. */
/* */
/* table_release :: Releases table data, then finalizes it. */
/* */
/**************************************************************************
*
* @struct:
* PS_Table_FuncsRec
*
* @description:
* A set of function pointers to manage PS_Table objects.
*
* @fields:
* table_init ::
* Used to initialize a table.
*
* table_done ::
* Finalizes resp. destroy a given table.
*
* table_add ::
* Adds a new object to a table.
*
* table_release ::
* Releases table data, then finalizes it.
*/
typedef struct PS_Table_FuncsRec_
{
FT_Error
@ -92,10 +96,10 @@ FT_BEGIN_HEADER
(*done)( PS_Table table );
FT_Error
(*add)( PS_Table table,
FT_Int idx,
void* object,
FT_UInt length );
(*add)( PS_Table table,
FT_Int idx,
const void* object,
FT_UInt length );
void
(*release)( PS_Table table );
@ -103,41 +107,47 @@ FT_BEGIN_HEADER
} PS_Table_FuncsRec;
/*************************************************************************/
/* */
/* <Struct> */
/* PS_TableRec */
/* */
/* <Description> */
/* A PS_Table is a simple object used to store an array of objects in */
/* a single memory block. */
/* */
/* <Fields> */
/* block :: The address in memory of the growheap's block. This */
/* can change between two object adds, due to */
/* reallocation. */
/* */
/* cursor :: The current top of the grow heap within its block. */
/* */
/* capacity :: The current size of the heap block. Increments by */
/* 1kByte chunks. */
/* */
/* init :: Set to 0xDEADBEEF if `elements' and `lengths' have */
/* been allocated. */
/* */
/* max_elems :: The maximum number of elements in table. */
/* */
/* num_elems :: The current number of elements in table. */
/* */
/* elements :: A table of element addresses within the block. */
/* */
/* lengths :: A table of element sizes within the block. */
/* */
/* memory :: The object used for memory operations */
/* (alloc/realloc). */
/* */
/* funcs :: A table of method pointers for this object. */
/* */
/**************************************************************************
*
* @struct:
* PS_TableRec
*
* @description:
* A PS_Table is a simple object used to store an array of objects in a
* single memory block.
*
* @fields:
* block ::
* The address in memory of the growheap's block. This can change
* between two object adds, due to reallocation.
*
* cursor ::
* The current top of the grow heap within its block.
*
* capacity ::
* The current size of the heap block. Increments by 1kByte chunks.
*
* init ::
* Set to 0xDEADBEEF if 'elements' and 'lengths' have been allocated.
*
* max_elems ::
* The maximum number of elements in table.
*
* num_elems ::
* The current number of elements in table.
*
* elements ::
* A table of element addresses within the block.
*
* lengths ::
* A table of element sizes within the block.
*
* memory ::
* The object used for memory operations (alloc/realloc).
*
* funcs ::
* A table of method pointers for this object.
*/
typedef struct PS_TableRec_
{
FT_Byte* block; /* current memory block */
@ -425,27 +435,33 @@ FT_BEGIN_HEADER
} PS_Parser_FuncsRec;
/*************************************************************************/
/* */
/* <Struct> */
/* PS_ParserRec */
/* */
/* <Description> */
/* A PS_Parser is an object used to parse a Type 1 font very quickly. */
/* */
/* <Fields> */
/* cursor :: The current position in the text. */
/* */
/* base :: Start of the processed text. */
/* */
/* limit :: End of the processed text. */
/* */
/* error :: The last error returned. */
/* */
/* memory :: The object used for memory operations (alloc/realloc). */
/* */
/* funcs :: A table of functions for the parser. */
/* */
/**************************************************************************
*
* @struct:
* PS_ParserRec
*
* @description:
* A PS_Parser is an object used to parse a Type 1 font very quickly.
*
* @fields:
* cursor ::
* The current position in the text.
*
* base ::
* Start of the processed text.
*
* limit ::
* End of the processed text.
*
* error ::
* The last error returned.
*
* memory ::
* The object used for memory operations (alloc/realloc).
*
* funcs ::
* A table of functions for the parser.
*/
typedef struct PS_ParserRec_
{
FT_Byte* cursor;
@ -484,51 +500,67 @@ FT_BEGIN_HEADER
} PS_Builder_FuncsRec;
/*************************************************************************/
/* */
/* <Structure> */
/* PS_Builder */
/* */
/* <Description> */
/* A structure used during glyph loading to store its outline. */
/* */
/* <Fields> */
/* memory :: The current memory object. */
/* */
/* face :: The current face object. */
/* */
/* glyph :: The current glyph slot. */
/* */
/* loader :: XXX */
/* */
/* base :: The base glyph outline. */
/* */
/* current :: The current glyph outline. */
/* */
/* pos_x :: The horizontal translation (if composite glyph). */
/* */
/* pos_y :: The vertical translation (if composite glyph). */
/* */
/* left_bearing :: The left side bearing point. */
/* */
/* advance :: The horizontal advance vector. */
/* */
/* bbox :: Unused. */
/* */
/* path_begun :: A flag which indicates that a new path has begun. */
/* */
/* load_points :: If this flag is not set, no points are loaded. */
/* */
/* no_recurse :: Set but not used. */
/* */
/* metrics_only :: A boolean indicating that we only want to compute */
/* the metrics of a given glyph, not load all of its */
/* points. */
/* */
/* is_t1 :: Set if current font type is Type 1. */
/* */
/* funcs :: An array of function pointers for the builder. */
/* */
/**************************************************************************
*
* @struct:
* PS_Builder
*
* @description:
* A structure used during glyph loading to store its outline.
*
* @fields:
* memory ::
* The current memory object.
*
* face ::
* The current face object.
*
* glyph ::
* The current glyph slot.
*
* loader ::
* XXX
*
* base ::
* The base glyph outline.
*
* current ::
* The current glyph outline.
*
* pos_x ::
* The horizontal translation (if composite glyph).
*
* pos_y ::
* The vertical translation (if composite glyph).
*
* left_bearing ::
* The left side bearing point.
*
* advance ::
* The horizontal advance vector.
*
* bbox ::
* Unused.
*
* path_begun ::
* A flag which indicates that a new path has begun.
*
* load_points ::
* If this flag is not set, no points are loaded.
*
* no_recurse ::
* Set but not used.
*
* metrics_only ::
* A boolean indicating that we only want to compute the metrics of a
* given glyph, not load all of its points.
*
* is_t1 ::
* Set if current font type is Type 1.
*
* funcs ::
* An array of function pointers for the builder.
*/
struct PS_Builder_
{
FT_Memory memory;
@ -729,54 +761,70 @@ FT_BEGIN_HEADER
} T1_ParseState;
/*************************************************************************/
/* */
/* <Structure> */
/* T1_BuilderRec */
/* */
/* <Description> */
/* A structure used during glyph loading to store its outline. */
/* */
/* <Fields> */
/* memory :: The current memory object. */
/* */
/* face :: The current face object. */
/* */
/* glyph :: The current glyph slot. */
/* */
/* loader :: XXX */
/* */
/* base :: The base glyph outline. */
/* */
/* current :: The current glyph outline. */
/* */
/* max_points :: maximum points in builder outline */
/* */
/* max_contours :: Maximum number of contours in builder outline. */
/* */
/* pos_x :: The horizontal translation (if composite glyph). */
/* */
/* pos_y :: The vertical translation (if composite glyph). */
/* */
/* left_bearing :: The left side bearing point. */
/* */
/* advance :: The horizontal advance vector. */
/* */
/* bbox :: Unused. */
/* */
/* parse_state :: An enumeration which controls the charstring */
/* parsing state. */
/* */
/* load_points :: If this flag is not set, no points are loaded. */
/* */
/* no_recurse :: Set but not used. */
/* */
/* metrics_only :: A boolean indicating that we only want to compute */
/* the metrics of a given glyph, not load all of its */
/* points. */
/* */
/* funcs :: An array of function pointers for the builder. */
/* */
/**************************************************************************
*
* @struct:
* T1_BuilderRec
*
* @description:
* A structure used during glyph loading to store its outline.
*
* @fields:
* memory ::
* The current memory object.
*
* face ::
* The current face object.
*
* glyph ::
* The current glyph slot.
*
* loader ::
* XXX
*
* base ::
* The base glyph outline.
*
* current ::
* The current glyph outline.
*
* max_points ::
* maximum points in builder outline
*
* max_contours ::
* Maximum number of contours in builder outline.
*
* pos_x ::
* The horizontal translation (if composite glyph).
*
* pos_y ::
* The vertical translation (if composite glyph).
*
* left_bearing ::
* The left side bearing point.
*
* advance ::
* The horizontal advance vector.
*
* bbox ::
* Unused.
*
* parse_state ::
* An enumeration which controls the charstring parsing state.
*
* load_points ::
* If this flag is not set, no points are loaded.
*
* no_recurse ::
* Set but not used.
*
* metrics_only ::
* A boolean indicating that we only want to compute the metrics of a
* given glyph, not load all of its points.
*
* funcs ::
* An array of function pointers for the builder.
*/
typedef struct T1_BuilderRec_
{
FT_Memory memory;
@ -817,19 +865,19 @@ FT_BEGIN_HEADER
#if 0
/*************************************************************************/
/* */
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
/* calls during glyph loading. */
/* */
/**************************************************************************
*
* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine
* calls during glyph loading.
*/
#define T1_MAX_SUBRS_CALLS 8
/*************************************************************************/
/* */
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
/* minimum of 16 is required. */
/* */
/**************************************************************************
*
* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A
* minimum of 16 is required.
*/
#define T1_MAX_CHARSTRINGS_OPERANDS 32
#endif /* 0 */
@ -993,53 +1041,70 @@ FT_BEGIN_HEADER
} CFF_Builder_FuncsRec;
/*************************************************************************/
/* */
/* <Structure> */
/* CFF_Builder */
/* */
/* <Description> */
/* A structure used during glyph loading to store its outline. */
/* */
/* <Fields> */
/* memory :: The current memory object. */
/* */
/* face :: The current face object. */
/* */
/* glyph :: The current glyph slot. */
/* */
/* loader :: The current glyph loader. */
/* */
/* base :: The base glyph outline. */
/* */
/* current :: The current glyph outline. */
/* */
/* pos_x :: The horizontal translation (if composite glyph). */
/* */
/* pos_y :: The vertical translation (if composite glyph). */
/* */
/* left_bearing :: The left side bearing point. */
/* */
/* advance :: The horizontal advance vector. */
/* */
/* bbox :: Unused. */
/* */
/* path_begun :: A flag which indicates that a new path has begun. */
/* */
/* load_points :: If this flag is not set, no points are loaded. */
/* */
/* no_recurse :: Set but not used. */
/* */
/* metrics_only :: A boolean indicating that we only want to compute */
/* the metrics of a given glyph, not load all of its */
/* points. */
/* */
/* hints_funcs :: Auxiliary pointer for hinting. */
/* */
/* hints_globals :: Auxiliary pointer for hinting. */
/* */
/* funcs :: A table of method pointers for this object. */
/* */
/**************************************************************************
*
* @struct:
* CFF_Builder
*
* @description:
* A structure used during glyph loading to store its outline.
*
* @fields:
* memory ::
* The current memory object.
*
* face ::
* The current face object.
*
* glyph ::
* The current glyph slot.
*
* loader ::
* The current glyph loader.
*
* base ::
* The base glyph outline.
*
* current ::
* The current glyph outline.
*
* pos_x ::
* The horizontal translation (if composite glyph).
*
* pos_y ::
* The vertical translation (if composite glyph).
*
* left_bearing ::
* The left side bearing point.
*
* advance ::
* The horizontal advance vector.
*
* bbox ::
* Unused.
*
* path_begun ::
* A flag which indicates that a new path has begun.
*
* load_points ::
* If this flag is not set, no points are loaded.
*
* no_recurse ::
* Set but not used.
*
* metrics_only ::
* A boolean indicating that we only want to compute the metrics of a
* given glyph, not load all of its points.
*
* hints_funcs ::
* Auxiliary pointer for hinting.
*
* hints_globals ::
* Auxiliary pointer for hinting.
*
* funcs ::
* A table of method pointers for this object.
*/
struct CFF_Builder_
{
FT_Memory memory;
@ -1211,25 +1276,27 @@ FT_BEGIN_HEADER
typedef struct AFM_StreamRec_* AFM_Stream;
/*************************************************************************/
/* */
/* <Struct> */
/* AFM_ParserRec */
/* */
/* <Description> */
/* An AFM_Parser is a parser for the AFM files. */
/* */
/* <Fields> */
/* memory :: The object used for memory operations (alloc and */
/* realloc). */
/* */
/* stream :: This is an opaque object. */
/* */
/* FontInfo :: The result will be stored here. */
/* */
/* get_index :: A user provided function to get a glyph index by its */
/* name. */
/* */
/**************************************************************************
*
* @struct:
* AFM_ParserRec
*
* @description:
* An AFM_Parser is a parser for the AFM files.
*
* @fields:
* memory ::
* The object used for memory operations (alloc and realloc).
*
* stream ::
* This is an opaque object.
*
* FontInfo ::
* The result will be stored here.
*
* get_index ::
* A user provided function to get a glyph index by its name.
*/
typedef struct AFM_ParserRec_
{
FT_Memory memory;

View File

@ -1,21 +1,21 @@
/***************************************************************************/
/* */
/* pshints.h */
/* */
/* Interface to Postscript-specific (Type 1 and Type 2) hints */
/* recorders (specification only). These are used to support native */
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
/* */
/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* pshints.h
*
* Interface to Postscript-specific (Type 1 and Type 2) hints
* recorders (specification only). These are used to support native
* T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
*
* Copyright (C) 2001-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef PSHINTS_H_
@ -73,7 +73,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/*************************************************************************
/**************************************************************************
*
* @type:
* T1_Hints
@ -86,16 +86,16 @@ FT_BEGIN_HEADER
* @T1_Hints_FuncsRec structure. Recording glyph hints is normally
* achieved through the following scheme:
*
* - Open a new hint recording session by calling the `open' method.
* - Open a new hint recording session by calling the 'open' method.
* This rewinds the recorder and prepare it for new input.
*
* - For each hint found in the glyph charstring, call the corresponding
* method (`stem', `stem3', or `reset'). Note that these functions do
* method ('stem', 'stem3', or 'reset'). Note that these functions do
* not return an error code.
*
* - Close the recording session by calling the `close' method. It
* returns an error code if the hints were invalid or something
* strange happened (e.g., memory shortage).
* - Close the recording session by calling the 'close' method. It
* returns an error code if the hints were invalid or something strange
* happened (e.g., memory shortage).
*
* The hints accumulated in the object can later be used by the
* PostScript hinter.
@ -104,7 +104,7 @@ FT_BEGIN_HEADER
typedef struct T1_HintsRec_* T1_Hints;
/*************************************************************************
/**************************************************************************
*
* @type:
* T1_Hints_Funcs
@ -117,7 +117,7 @@ FT_BEGIN_HEADER
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
/*************************************************************************
/**************************************************************************
*
* @functype:
* T1_Hints_OpenFunc
@ -139,14 +139,14 @@ FT_BEGIN_HEADER
(*T1_Hints_OpenFunc)( T1_Hints hints );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T1_Hints_SetStemFunc
*
* @description:
* A method of the @T1_Hints class used to record a new horizontal or
* vertical stem. This corresponds to the Type 1 `hstem' and `vstem'
* vertical stem. This corresponds to the Type 1 'hstem' and 'vstem'
* operators.
*
* @input:
@ -164,15 +164,15 @@ FT_BEGIN_HEADER
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
* horizontal coordinates (x) for vertical stems (dim=1).
*
* `coords[0]' is the absolute stem position (lowest coordinate);
* `coords[1]' is the length.
* 'coords[0]' is the absolute stem position (lowest coordinate);
* 'coords[1]' is the length.
*
* The length can be negative, in which case it must be either -20 or
* -21. It is interpreted as a `ghost' stem, according to the Type 1
* -21. It is interpreted as a 'ghost' stem, according to the Type 1
* specification.
*
* If the length is -21 (corresponding to a bottom ghost stem), then
* the real stem position is `coords[0]+coords[1]'.
* If the length is -21 (corresponding to a bottom ghost stem), then the
* real stem position is 'coords[0]+coords[1]'.
*
*/
typedef void
@ -181,7 +181,7 @@ FT_BEGIN_HEADER
FT_Fixed* coords );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T1_Hints_SetStem3Func
@ -215,7 +215,7 @@ FT_BEGIN_HEADER
FT_Fixed* coords );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T1_Hints_ResetFunc
@ -238,7 +238,7 @@ FT_BEGIN_HEADER
FT_UInt end_point );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T1_Hints_CloseFunc
@ -267,7 +267,7 @@ FT_BEGIN_HEADER
FT_UInt end_point );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T1_Hints_ApplyFunc
@ -297,7 +297,7 @@ FT_BEGIN_HEADER
* On input, all points within the outline are in font coordinates. On
* output, they are in 1/64th of pixels.
*
* The scaling transformation is taken from the `globals' object which
* The scaling transformation is taken from the 'globals' object which
* must correspond to the same font as the glyph.
*
*/
@ -308,7 +308,7 @@ FT_BEGIN_HEADER
FT_Render_Mode hint_mode );
/*************************************************************************
/**************************************************************************
*
* @struct:
* T1_Hints_FuncsRec
@ -360,7 +360,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/*************************************************************************
/**************************************************************************
*
* @type:
* T2_Hints
@ -373,16 +373,16 @@ FT_BEGIN_HEADER
* @T2_Hints_FuncsRec structure. Recording glyph hints is normally
* achieved through the following scheme:
*
* - Open a new hint recording session by calling the `open' method.
* - Open a new hint recording session by calling the 'open' method.
* This rewinds the recorder and prepare it for new input.
*
* - For each hint found in the glyph charstring, call the corresponding
* method (`stems', `hintmask', `counters'). Note that these
* functions do not return an error code.
* method ('stems', 'hintmask', 'counters'). Note that these functions
* do not return an error code.
*
* - Close the recording session by calling the `close' method. It
* returns an error code if the hints were invalid or something
* strange happened (e.g., memory shortage).
* - Close the recording session by calling the 'close' method. It
* returns an error code if the hints were invalid or something strange
* happened (e.g., memory shortage).
*
* The hints accumulated in the object can later be used by the
* Postscript hinter.
@ -391,7 +391,7 @@ FT_BEGIN_HEADER
typedef struct T2_HintsRec_* T2_Hints;
/*************************************************************************
/**************************************************************************
*
* @type:
* T2_Hints_Funcs
@ -404,7 +404,7 @@ FT_BEGIN_HEADER
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
/*************************************************************************
/**************************************************************************
*
* @functype:
* T2_Hints_OpenFunc
@ -426,7 +426,7 @@ FT_BEGIN_HEADER
(*T2_Hints_OpenFunc)( T2_Hints hints );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T2_Hints_StemsFunc
@ -434,7 +434,7 @@ FT_BEGIN_HEADER
* @description:
* A method of the @T2_Hints class used to set the table of stems in
* either the vertical or horizontal dimension. Equivalent to the
* `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.
* 'hstem', 'vstem', 'hstemhm', and 'vstemhm' Type 2 operators.
*
* @input:
* hints ::
@ -447,18 +447,18 @@ FT_BEGIN_HEADER
* The number of stems.
*
* coords ::
* An array of `count' (position,length) pairs in 16.16 format.
* An array of 'count' (position,length) pairs in 16.16 format.
*
* @note:
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
* horizontal coordinates (x) for vertical stems (dim=1).
*
* There are `2*count' elements in the `coords' array. Each even
* element is an absolute position in font units, each odd element is a
* length in font units.
* There are '2*count' elements in the 'coords' array. Each even element
* is an absolute position in font units, each odd element is a length in
* font units.
*
* A length can be negative, in which case it must be either -20 or
* -21. It is interpreted as a `ghost' stem, according to the Type 1
* A length can be negative, in which case it must be either -20 or -21.
* It is interpreted as a 'ghost' stem, according to the Type 1
* specification.
*
*/
@ -469,22 +469,22 @@ FT_BEGIN_HEADER
FT_Fixed* coordinates );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T2_Hints_MaskFunc
*
* @description:
* A method of the @T2_Hints class used to set a given hintmask (this
* corresponds to the `hintmask' Type 2 operator).
* corresponds to the 'hintmask' Type 2 operator).
*
* @input:
* hints ::
* A handle to the Type 2 hints recorder.
*
* end_point ::
* The glyph index of the last point to which the previously defined
* or activated hints apply.
* The glyph index of the last point to which the previously defined or
* activated hints apply.
*
* bit_count ::
* The number of bits in the hint mask.
@ -494,13 +494,13 @@ FT_BEGIN_HEADER
*
* @note:
* If the hintmask starts the charstring (before any glyph point
* definition), the value of `end_point' should be 0.
* definition), the value of `end_point` should be 0.
*
* `bit_count' is the number of meaningful bits in the `bytes' array; it
* `bit_count` is the number of meaningful bits in the 'bytes' array; it
* must be equal to the total number of hints defined so far (i.e.,
* horizontal+verticals).
*
* The `bytes' array can come directly from the Type 2 charstring and
* The 'bytes' array can come directly from the Type 2 charstring and
* respects the same format.
*
*/
@ -511,14 +511,14 @@ FT_BEGIN_HEADER
const FT_Byte* bytes );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T2_Hints_CounterFunc
*
* @description:
* A method of the @T2_Hints class used to set a given counter mask
* (this corresponds to the `hintmask' Type 2 operator).
* A method of the @T2_Hints class used to set a given counter mask (this
* corresponds to the 'hintmask' Type 2 operator).
*
* @input:
* hints ::
@ -536,13 +536,13 @@ FT_BEGIN_HEADER
*
* @note:
* If the hintmask starts the charstring (before any glyph point
* definition), the value of `end_point' should be 0.
* definition), the value of `end_point` should be 0.
*
* `bit_count' is the number of meaningful bits in the `bytes' array; it
* `bit_count` is the number of meaningful bits in the 'bytes' array; it
* must be equal to the total number of hints defined so far (i.e.,
* horizontal+verticals).
*
* The `bytes' array can come directly from the Type 2 charstring and
* The 'bytes' array can come directly from the Type 2 charstring and
* respects the same format.
*
*/
@ -552,7 +552,7 @@ FT_BEGIN_HEADER
const FT_Byte* bytes );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T2_Hints_CloseFunc
@ -581,15 +581,14 @@ FT_BEGIN_HEADER
FT_UInt end_point );
/*************************************************************************
/**************************************************************************
*
* @functype:
* T2_Hints_ApplyFunc
*
* @description:
* A method of the @T2_Hints class used to apply hints to the
* corresponding glyph outline. Must be called after the `close'
* method.
* corresponding glyph outline. Must be called after the 'close' method.
*
* @input:
* hints ::
@ -611,7 +610,7 @@ FT_BEGIN_HEADER
* On input, all points within the outline are in font coordinates. On
* output, they are in 1/64th of pixels.
*
* The scaling transformation is taken from the `globals' object which
* The scaling transformation is taken from the 'globals' object which
* must correspond to the same font than the glyph.
*
*/
@ -622,7 +621,7 @@ FT_BEGIN_HEADER
FT_Render_Mode hint_mode );
/*************************************************************************
/**************************************************************************
*
* @struct:
* T2_Hints_FuncsRec
@ -680,8 +679,6 @@ FT_BEGIN_HEADER
typedef PSHinter_Interface* PSHinter_Service;
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_PSHINTER_INTERFACE( \
class_, \
get_globals_funcs_, \
@ -694,25 +691,6 @@ FT_BEGIN_HEADER
get_t2_funcs_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_PSHINTER_INTERFACE( \
class_, \
get_globals_funcs_, \
get_t1_funcs_, \
get_t2_funcs_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
PSHinter_Interface* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_globals_funcs = get_globals_funcs_; \
clazz->get_t1_funcs = get_t1_funcs_; \
clazz->get_t2_funcs = get_t2_funcs_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svbdf.h */
/* */
/* The FreeType BDF services (specification). */
/* */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svbdf.h
*
* The FreeType BDF services (specification).
*
* Copyright (C) 2003-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVBDF_H_
@ -46,8 +46,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_BDFRec( class_, \
get_charset_id_, \
get_property_ ) \
@ -56,20 +54,6 @@ FT_BEGIN_HEADER
get_charset_id_, get_property_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_BDFRec( class_, \
get_charset_id_, \
get_property_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_BDFRec* clazz ) \
{ \
clazz->get_charset_id = get_charset_id_; \
clazz->get_property = get_property_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svcfftl.h */
/* */
/* The FreeType CFF tables loader service (specification). */
/* */
/* Copyright 2017-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svcfftl.h
*
* The FreeType CFF tables loader service (specification).
*
* Copyright (C) 2017-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVCFFTL_H_
@ -65,8 +65,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
get_standard_encoding_, \
load_private_dict_, \
@ -82,26 +80,6 @@ FT_BEGIN_HEADER
blend_build_vector_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
get_standard_encoding_, \
load_private_dict_, \
fd_select_get_, \
blend_check_vector_, \
blend_build_vector_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_CFFLoadRec* clazz ) \
{ \
clazz->get_standard_encoding = get_standard_encoding_; \
clazz->load_private_dict = load_private_dict_; \
clazz->fd_select_get = fd_select_get_; \
clazz->blend_check_vector = blend_check_vector_; \
clazz->blend_build_vector = blend_build_vector_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svcid.h */
/* */
/* The FreeType CID font services (specification). */
/* */
/* Copyright 2007-2018 by */
/* Derek Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svcid.h
*
* The FreeType CID font services (specification).
*
* Copyright (C) 2007-2019 by
* Derek Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVCID_H_
@ -48,8 +48,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_CIDREC( class_, \
get_ros_, \
get_is_cid_, \
@ -59,25 +57,6 @@ FT_BEGIN_HEADER
get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_CIDREC( class_, \
get_ros_, \
get_is_cid_, \
get_cid_from_glyph_index_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_CIDRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_ros = get_ros_; \
clazz->get_is_cid = get_is_cid_; \
clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svfntfmt.h */
/* */
/* The FreeType font format service (specification only). */
/* */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svfntfmt.h
*
* The FreeType font format service (specification only).
*
* Copyright (C) 2003-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVFNTFMT_H_
@ -26,9 +26,9 @@ FT_BEGIN_HEADER
/*
* A trivial service used to return the name of a face's font driver,
* according to the XFree86 nomenclature. Note that the service data
* is a simple constant string pointer.
* A trivial service used to return the name of a face's font driver,
* according to the XFree86 nomenclature. Note that the service data is a
* simple constant string pointer.
*/
#define FT_SERVICE_ID_FONT_FORMAT "font-format"

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svgldict.h */
/* */
/* The FreeType glyph dictionary services (specification). */
/* */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svgldict.h
*
* The FreeType glyph dictionary services (specification).
*
* Copyright (C) 2003-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVGLDICT_H_
@ -26,8 +26,8 @@ FT_BEGIN_HEADER
/*
* A service used to retrieve glyph names, as well as to find the
* index of a given glyph name in a font.
* A service used to retrieve glyph names, as well as to find the index of
* a given glyph name in a font.
*
*/
@ -41,8 +41,8 @@ FT_BEGIN_HEADER
FT_UInt buffer_max );
typedef FT_UInt
(*FT_GlyphDict_NameIndexFunc)( FT_Face face,
FT_String* glyph_name );
(*FT_GlyphDict_NameIndexFunc)( FT_Face face,
const FT_String* glyph_name );
FT_DEFINE_SERVICE( GlyphDict )
@ -52,8 +52,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
name_index_ ) \
@ -62,23 +60,6 @@ FT_BEGIN_HEADER
get_name_, name_index_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
name_index_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_GlyphDictRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_name = get_name_; \
clazz->name_index = name_index_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -1,28 +1,28 @@
/***************************************************************************/
/* */
/* svgxval.h */
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004-2018 by */
/* Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svgxval.h
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
* Copyright (C) 2004-2019 by
* Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
/****************************************************************************
*
* gxvalid is derived from both gxlayout module and otvalid module.
* Development of gxlayout is supported by the Information-technology
* Promotion Agency(IPA), Japan.
*
*/
#ifndef SVGXVAL_H_

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svkern.h */
/* */
/* The FreeType Kerning service (specification). */
/* */
/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svkern.h
*
* The FreeType Kerning service (specification).
*
* Copyright (C) 2006-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVKERN_H_

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svmetric.h */
/* */
/* The FreeType services for metrics variations (specification). */
/* */
/* Copyright 2016-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svmetric.h
*
* The FreeType services for metrics variations (specification).
*
* Copyright (C) 2016-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVMETRIC_H_
@ -26,7 +26,7 @@ FT_BEGIN_HEADER
/*
* A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables.
* A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables.
*
*/
@ -93,8 +93,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
hadvance_adjust_, \
lsb_adjust_, \
@ -116,32 +114,6 @@ FT_BEGIN_HEADER
metrics_adjust_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
hadvance_adjust_, \
lsb_adjust_, \
rsb_adjust_, \
vadvance_adjust_, \
tsb_adjust_, \
bsb_adjust_, \
vorg_adjust_, \
metrics_adjust_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_MetricsVariationsRec* clazz ) \
{ \
clazz->hadvance_adjust = hadvance_adjust_; \
clazz->lsb_adjust = lsb_adjust_; \
clazz->rsb_adjust = rsb_adjust_; \
clazz->vadvance_adjust = vadvance_adjust_; \
clazz->tsb_adjust = tsb_adjust_; \
clazz->bsb_adjust = bsb_adjust_; \
clazz->vorg_adjust = vorg_adjust_; \
clazz->metrics_adjust = metrics_adjust_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svmm.h */
/* */
/* The FreeType Multiple Masters and GX var services (specification). */
/* */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svmm.h
*
* The FreeType Multiple Masters and GX var services (specification).
*
* Copyright (C) 2003-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVMM_H_
@ -26,9 +26,9 @@ FT_BEGIN_HEADER
/*
* A service used to manage multiple-masters data in a given face.
* A service used to manage multiple-masters data in a given face.
*
* See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
* See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
*
*/
@ -86,81 +86,65 @@ FT_BEGIN_HEADER
typedef void
(*FT_Done_Blend_Func)( FT_Face );
typedef FT_Error
(*FT_Set_MM_WeightVector_Func)( FT_Face face,
FT_UInt len,
FT_Fixed* weight_vector );
typedef FT_Error
(*FT_Get_MM_WeightVector_Func)( FT_Face face,
FT_UInt* len,
FT_Fixed* weight_vector );
FT_DEFINE_SERVICE( MultiMasters )
{
FT_Get_MM_Func get_mm;
FT_Set_MM_Design_Func set_mm_design;
FT_Set_MM_Blend_Func set_mm_blend;
FT_Get_MM_Blend_Func get_mm_blend;
FT_Get_MM_Var_Func get_mm_var;
FT_Set_Var_Design_Func set_var_design;
FT_Get_Var_Design_Func get_var_design;
FT_Set_Instance_Func set_instance;
FT_Get_MM_Func get_mm;
FT_Set_MM_Design_Func set_mm_design;
FT_Set_MM_Blend_Func set_mm_blend;
FT_Get_MM_Blend_Func get_mm_blend;
FT_Get_MM_Var_Func get_mm_var;
FT_Set_Var_Design_Func set_var_design;
FT_Get_Var_Design_Func get_var_design;
FT_Set_Instance_Func set_instance;
FT_Set_MM_WeightVector_Func set_mm_weightvector;
FT_Get_MM_WeightVector_Func get_mm_weightvector;
/* for internal use; only needed for code sharing between modules */
FT_Get_Var_Blend_Func get_var_blend;
FT_Done_Blend_Func done_blend;
FT_Get_Var_Blend_Func get_var_blend;
FT_Done_Blend_Func done_blend;
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
set_var_design_, \
get_var_design_, \
set_instance_, \
get_var_blend_, \
done_blend_ ) \
static const FT_Service_MultiMastersRec class_ = \
{ \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
set_var_design_, \
get_var_design_, \
set_instance_, \
get_var_blend_, \
done_blend_ \
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
set_var_design_, \
get_var_design_, \
set_instance_, \
set_weightvector_, \
get_weightvector_, \
get_var_blend_, \
done_blend_ ) \
static const FT_Service_MultiMastersRec class_ = \
{ \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
set_var_design_, \
get_var_design_, \
set_instance_, \
set_weightvector_, \
get_weightvector_, \
get_var_blend_, \
done_blend_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
set_var_design_, \
get_var_design_, \
set_instance_, \
get_var_blend_, \
done_blend_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
{ \
clazz->get_mm = get_mm_; \
clazz->set_mm_design = set_mm_design_; \
clazz->set_mm_blend = set_mm_blend_; \
clazz->get_mm_blend = get_mm_blend_; \
clazz->get_mm_var = get_mm_var_; \
clazz->set_var_design = set_var_design_; \
clazz->get_var_design = get_var_design_; \
clazz->set_instance = set_instance_; \
clazz->get_var_blend = get_var_blend_; \
clazz->done_blend = done_blend_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svotval.h */
/* */
/* The FreeType OpenType validation service (specification). */
/* */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svotval.h
*
* The FreeType OpenType validation service (specification).
*
* Copyright (C) 2004-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVOTVAL_H_

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svpfr.h */
/* */
/* Internal PFR service functions (specification). */
/* */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svpfr.h
*
* Internal PFR service functions (specification).
*
* Copyright (C) 2003-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVPFR_H_

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svpostnm.h */
/* */
/* The FreeType PostScript name services (specification). */
/* */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svpostnm.h
*
* The FreeType PostScript name services (specification).
*
* Copyright (C) 2003-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVPOSTNM_H_
@ -25,13 +25,13 @@
FT_BEGIN_HEADER
/*
* A trivial service used to retrieve the PostScript name of a given
* font when available. The `get_name' field should never be NULL.
* A trivial service used to retrieve the PostScript name of a given font
* when available. The `get_name' field should never be `NULL`.
*
* The corresponding function can return NULL to indicate that the
* PostScript name is not available.
* The corresponding function can return `NULL` to indicate that the
* PostScript name is not available.
*
* The name is owned by the face and will be destroyed with it.
* The name is owned by the face and will be destroyed with it.
*/
#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name"
@ -47,28 +47,12 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
static const FT_Service_PsFontNameRec class_ = \
{ \
get_ps_font_name_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_PsFontNameRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_ps_font_name = get_ps_font_name_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* svprop.h */
/* */
/* The FreeType property service (specification). */
/* */
/* Copyright 2012-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* svprop.h
*
* The FreeType property service (specification).
*
* Copyright (C) 2012-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef SVPROP_H_
@ -45,8 +45,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
set_property_, \
get_property_ ) \
@ -56,20 +54,6 @@ FT_BEGIN_HEADER
get_property_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
set_property_, \
get_property_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_PropertiesRec* clazz ) \
{ \
clazz->set_property = set_property_; \
clazz->get_property = get_property_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

Some files were not shown because too many files have changed in this diff Show More