FreeType: Cleanup some unused files
This commit is contained in:
parent
d5c1de784c
commit
03ff10de8a
|
@ -176,7 +176,7 @@ License: OFL-1.1
|
|||
|
||||
Files: ./thirdparty/freetype/
|
||||
Comment: The FreeType Project
|
||||
Copyright: 1996-2021, David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
Copyright: 1996-2022, David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
License: FTL
|
||||
|
||||
Files: ./thirdparty/glslang/
|
||||
|
|
|
@ -159,8 +159,9 @@ Files extracted from upstream source:
|
|||
|
||||
Files extracted from upstream source:
|
||||
|
||||
- the `src/` folder, minus the `.mk` files and the `dlg` and `tools` subfolders
|
||||
- the `include/` folder, minus the `dlg` subfolder
|
||||
- `src/` folder, minus the `dlg` and `tools` subfolders
|
||||
* These files can be removed: `.dat`, `.diff`, `.mk`, `.rc`, `README*`
|
||||
- `include/` folder, minus the `dlg` subfolder
|
||||
- `LICENSE.TXT` and `docs/FTL.TXT`
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,61 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftver.rc */
|
||||
/* */
|
||||
/* FreeType VERSIONINFO resource for Windows DLLs. */
|
||||
/* */
|
||||
/* Copyright (C) 2018-2022 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include<windows.h>
|
||||
|
||||
#define FT_VERSION 2,12,1,0
|
||||
#define FT_VERSION_STR "2.12.1"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION FT_VERSION
|
||||
PRODUCTVERSION FT_VERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#endif
|
||||
#ifdef DLL_EXPORT
|
||||
FILETYPE VFT_DLL
|
||||
#define FT_FILENAME "freetype.dll"
|
||||
#else
|
||||
FILETYPE VFT_STATIC_LIB
|
||||
#define FT_FILENAME "freetype.lib"
|
||||
#endif
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "The FreeType Project"
|
||||
VALUE "FileDescription", "Font Rendering Library"
|
||||
VALUE "FileVersion", FT_VERSION_STR
|
||||
VALUE "ProductName", "FreeType"
|
||||
VALUE "ProductVersion", FT_VERSION_STR
|
||||
VALUE "LegalCopyright", "\251 2000-2022 The FreeType Project www.freetype.org. All rights reserved."
|
||||
VALUE "InternalName", "freetype"
|
||||
VALUE "OriginalFilename", FT_FILENAME
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
/* The following line should only be modified for localized versions. */
|
||||
/* It consists of any number of WORD,WORD pairs, with each pair */
|
||||
/* describing a "language,codepage" combination supported by the file. */
|
||||
VALUE "Translation", 0x409, 1252
|
||||
END
|
||||
END
|
|
@ -1,152 +0,0 @@
|
|||
FreeType font driver for BDF fonts
|
||||
|
||||
Francesco Zappa Nardelli
|
||||
<francesco.zappa.nardelli@ens.fr>
|
||||
|
||||
|
||||
Introduction
|
||||
************
|
||||
|
||||
BDF (Bitmap Distribution Format) is a bitmap font format defined by Adobe,
|
||||
which is intended to be easily understood by both humans and computers.
|
||||
This code implements a BDF driver for the FreeType library, following the
|
||||
Adobe Specification V 2.2. The specification of the BDF font format is
|
||||
available from Adobe's web site:
|
||||
|
||||
https://adobe-type-tools.github.io/font-tech-notes/pdfs/5005.BDF_Spec.pdf
|
||||
|
||||
Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
|
||||
They do not define vertical metrics, because the X Consortium BDF
|
||||
specification has removed them.
|
||||
|
||||
|
||||
Encodings
|
||||
*********
|
||||
|
||||
[This section is out of date, retained for historical reasons. BDF
|
||||
properties can be retrieved with `FT_Get_BDF_Property`, character set ID
|
||||
values with `FT_Get_BDF_Charset_ID`.]
|
||||
|
||||
The variety of encodings that accompanies bdf fonts appears to encompass the
|
||||
small set defined in freetype.h. On the other hand, two properties that
|
||||
specify encoding and registry are usually defined in bdf fonts.
|
||||
|
||||
I decided to make these two properties directly accessible, leaving to the
|
||||
client application the work of interpreting them. For instance:
|
||||
|
||||
|
||||
#include FT_INTERNAL_BDF_TYPES_H
|
||||
|
||||
FT_Face face;
|
||||
BDF_Public_Face bdfface;
|
||||
|
||||
|
||||
FT_New_Face( library, ..., &face );
|
||||
|
||||
bdfface = (BDF_Public_Face)face;
|
||||
|
||||
if ( ( bdfface->charset_registry == "ISO10646" ) &&
|
||||
( bdfface->charset_encoding == "1" ) )
|
||||
[..]
|
||||
|
||||
|
||||
Thus the driver always exports `ft_encoding_none' as face->charmap.encoding.
|
||||
FT_Get_Char_Index's behavior is unmodified, that is, it converts the ULong
|
||||
value given as argument into the corresponding glyph number.
|
||||
|
||||
If the two properties are not available, Adobe Standard Encoding should be
|
||||
assumed.
|
||||
|
||||
|
||||
Anti-Aliased Bitmaps
|
||||
********************
|
||||
|
||||
The driver supports an extension to the BDF format as used in Mark Leisher's
|
||||
xmbdfed bitmap font editor. Microsoft's SBIT tool expects bitmap fonts in
|
||||
that format for adding anti-aliased them to TrueType fonts. It introduces a
|
||||
fourth field to the `SIZE' keyword which gives the bpp value (bits per
|
||||
pixel) of the glyph data in the font. Possible values are 1 (the default),
|
||||
2 (four gray levels), 4 (16 gray levels), and 8 (256 gray levels). The
|
||||
driver returns either a bitmap with 1 bit per pixel or a pixmap with 8bits
|
||||
per pixel (using 4, 16, and 256 gray levels, respectively).
|
||||
|
||||
|
||||
Known problems
|
||||
**************
|
||||
|
||||
- A font is entirely loaded into memory. Obviously, this is not the Right
|
||||
Thing(TM). If you have big fonts I suggest you convert them into PCF
|
||||
format (using the bdftopcf utility): the PCF font drive of FreeType can
|
||||
perform incremental glyph loading.
|
||||
|
||||
When I have some time, I will implement on-demand glyph parsing.
|
||||
|
||||
- Except for encodings properties, client applications have no visibility of
|
||||
the PCF_Face object. This means that applications cannot directly access
|
||||
font tables and must trust FreeType.
|
||||
|
||||
- Currently, glyph names are ignored.
|
||||
|
||||
I plan to give full visibility of the BDF_Face object in an upcoming
|
||||
revision of the driver, thus implementing also glyph names.
|
||||
|
||||
- As I have never seen a BDF font that defines vertical metrics, vertical
|
||||
metrics are (parsed and) discarded. If you own a BDF font that defines
|
||||
vertical metrics, please let me know (I will implement them in 5-10
|
||||
minutes).
|
||||
|
||||
|
||||
License
|
||||
*******
|
||||
|
||||
Copyright (C) 2001-2002 by Francesco Zappa Nardelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*** Portions of the driver (that is, bdflib.c and bdf.h):
|
||||
|
||||
Copyright 2000 Computing Research Labs, New Mexico State University
|
||||
Copyright 2001-2002, 2011 Francesco Zappa Nardelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
||||
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
Credits
|
||||
*******
|
||||
|
||||
This driver is based on excellent Mark Leisher's bdf library. If you
|
||||
find something good in this driver you should probably thank him, not
|
||||
me.
|
|
@ -1,532 +0,0 @@
|
|||
gxvalid: TrueType GX validator
|
||||
==============================
|
||||
|
||||
|
||||
1. What is this
|
||||
---------------
|
||||
|
||||
`gxvalid' is a module to validate TrueType GX tables: a collection of
|
||||
additional tables in TrueType font which are used by `QuickDraw GX
|
||||
Text', Apple Advanced Typography (AAT). In addition, gxvalid can
|
||||
validates `kern' tables which have been extended for AAT. Like the
|
||||
otvalid module, gxvalid uses FreeType 2's validator framework
|
||||
(ftvalid).
|
||||
|
||||
You can link gxvalid with your program; before running your own layout
|
||||
engine, gxvalid validates a font file. As the result, you can remove
|
||||
error-checking code from the layout engine. It is also possible to
|
||||
use gxvalid as a stand-alone font validator; the `ftvalid' test
|
||||
program included in the ft2demo bundle calls gxvalid internally.
|
||||
A stand-alone font validator may be useful for font developers.
|
||||
|
||||
This documents documents the following issues.
|
||||
|
||||
- supported TrueType GX tables
|
||||
- fundamental validation limitations
|
||||
- permissive error handling of broken GX tables
|
||||
- `kern' table issue.
|
||||
|
||||
|
||||
2. Supported tables
|
||||
-------------------
|
||||
|
||||
The following GX tables are currently supported.
|
||||
|
||||
bsln
|
||||
feat
|
||||
just
|
||||
kern(*)
|
||||
lcar
|
||||
mort
|
||||
morx
|
||||
opbd
|
||||
prop
|
||||
trak
|
||||
|
||||
The following GX tables are currently unsupported.
|
||||
|
||||
cvar
|
||||
fdsc
|
||||
fmtx
|
||||
fvar
|
||||
gvar
|
||||
Zapf
|
||||
|
||||
The following GX tables won't be supported.
|
||||
|
||||
acnt(**)
|
||||
hsty(***)
|
||||
|
||||
The following undocumented tables in TrueType fonts designed for Apple
|
||||
platform aren't handled either.
|
||||
|
||||
addg
|
||||
CVTM
|
||||
TPNM
|
||||
umif
|
||||
|
||||
|
||||
*) The `kern' validator handles both the classic and the new kern
|
||||
formats; the former is supported on both Microsoft and Apple
|
||||
platforms, while the latter is supported on Apple platforms.
|
||||
|
||||
**) `acnt' tables are not supported by currently available Apple font
|
||||
tools.
|
||||
|
||||
***) There is one more Apple extension, `hsty', but it is for
|
||||
Newton-OS, not GX (Newton-OS is a platform by Apple, but it can
|
||||
use sfnt- housed bitmap fonts only). Therefore, it should be
|
||||
excluded from `Apple platform' in the context of TrueType.
|
||||
gxvalid ignores it as Apple font tools do so.
|
||||
|
||||
|
||||
We have checked 183 fonts bundled with MacOS 9.1, MacOS 9.2, MacOS
|
||||
10.0, MacOS X 10.1, MSIE for MacOS, and AppleWorks 6.0. In addition,
|
||||
we have checked 67 Dynalab fonts (designed for MacOS) and 189 Ricoh
|
||||
fonts (designed for Windows and MacOS dual platforms). The number of
|
||||
fonts including TrueType GX tables are as follows.
|
||||
|
||||
bsln: 76
|
||||
feat: 191
|
||||
just: 84
|
||||
kern: 59
|
||||
lcar: 4
|
||||
mort: 326
|
||||
morx: 19
|
||||
opbd: 4
|
||||
prop: 114
|
||||
trak: 16
|
||||
|
||||
Dynalab and Ricoh fonts don't have GX tables except of `feat' and
|
||||
`mort'.
|
||||
|
||||
|
||||
3. Fundamental validation limitations
|
||||
-------------------------------------
|
||||
|
||||
TrueType GX provides layout information to libraries for font
|
||||
rasterizers and text layout. gxvalid can check whether the layout
|
||||
data in a font is conformant to the TrueType GX format specified by
|
||||
Apple. But gxvalid cannot check a how QuickDraw GX/AAT renderer uses
|
||||
the stored information.
|
||||
|
||||
3-1. Validation of State Machine activity
|
||||
-----------------------------------------
|
||||
|
||||
QuickDraw GX/AAT uses a `State Machine' to provide `stateful' layout
|
||||
features, and TrueType GX stores the state transition diagram of
|
||||
this `State Machine' in a `StateTable' data structure. While the
|
||||
State Machine receives a series of glyph IDs, the State Machine
|
||||
starts with `start of text' state, walks around various states and
|
||||
generates various layout information to the renderer, and finally
|
||||
reaches the `end of text' state.
|
||||
|
||||
gxvalid can check essential errors like:
|
||||
|
||||
- possibility of state transitions to undefined states
|
||||
- existence of glyph IDs that the State Machine doesn't know how
|
||||
to handle
|
||||
- the State Machine cannot compute the layout information from
|
||||
given diagram
|
||||
|
||||
These errors can be checked within finite steps, and without the
|
||||
State Machine itself, because these are `expression' errors of state
|
||||
transition diagram.
|
||||
|
||||
There is no limitation about how long the State Machine walks
|
||||
around, so validation of the algorithm in the state transition
|
||||
diagram requires infinite steps, even if we had a State Machine in
|
||||
gxvalid. Therefore, the following errors and problems cannot be
|
||||
checked.
|
||||
|
||||
- existence of states which the State Machine never transits to
|
||||
- the possibility that the State Machine never reaches `end of
|
||||
text'
|
||||
- the possibility of stack underflow/overflow in the State Machine
|
||||
(in ligature and contextual glyph substitutions, the State
|
||||
Machine can store 16 glyphs onto its stack)
|
||||
|
||||
In addition, gxvalid doesn't check `temporary glyph IDs' used in the
|
||||
chained State Machines (in `mort' and `morx' tables). If a layout
|
||||
feature is implemented by a single State Machine, a glyph ID
|
||||
converted by the State Machine is passed to the glyph renderer, thus
|
||||
it should not point to an undefined glyph ID. But if a layout
|
||||
feature is implemented by chained State Machines, a component State
|
||||
Machine (if it is not the final one) is permitted to generate
|
||||
undefined glyph IDs for temporary use, because it is handled by next
|
||||
component State Machine and not by the glyph renderer. To validate
|
||||
such temporary glyph IDs, gxvalid must stack all undefined glyph IDs
|
||||
which can occur in the output of the previous State Machine and
|
||||
search them in the `ClassTable' structure of the current State
|
||||
Machine. It is too complex to list all possible glyph IDs from the
|
||||
StateTable, especially from a ligature substitution table.
|
||||
|
||||
3-2. Validation of relationship between multiple layout features
|
||||
----------------------------------------------------------------
|
||||
|
||||
gxvalid does not validate the relationship between multiple layout
|
||||
features at all.
|
||||
|
||||
If multiple layout features are defined in TrueType GX tables,
|
||||
possible interactions, overrides, and conflicts between layout
|
||||
features are implicitly given in the font too. For example, there
|
||||
are several predefined spacing control features:
|
||||
|
||||
- Text Spacing (Proportional/Monospace/Half-width/Normal)
|
||||
- Number Spacing (Monospaced-numbers/Proportional-numbers)
|
||||
- Kana Spacing (Full-width/Proportional)
|
||||
- Ideographic Spacing (Full-width/Proportional)
|
||||
- CJK Roman Spacing (Half-width/Proportional/Default-roman
|
||||
/Full-width-roman/Proportional)
|
||||
|
||||
If all layout features are independently managed, we can activate
|
||||
inconsistent typographic rules like `Text Spacing=Monospace' and
|
||||
`Ideographic Spacing=Proportional' at the same time.
|
||||
|
||||
The combinations of layout features is managed by a 32bit integer
|
||||
(one bit each for selector setting), so we can define relationships
|
||||
between up to 32 features, theoretically. But if one feature
|
||||
setting affects another feature setting, we need typographic
|
||||
priority rules to validate the relationship. Unfortunately, the
|
||||
TrueType GX format specification does not give such information even
|
||||
for predefined features.
|
||||
|
||||
|
||||
4. Permissive error handling of broken GX tables
|
||||
------------------------------------------------
|
||||
|
||||
When Apple's font rendering system finds an inconsistency, like a
|
||||
specification violation or an unspecified value in a TrueType GX
|
||||
table, it does not always return error. In most cases, the rendering
|
||||
engine silently ignores such wrong values or even whole tables. In
|
||||
fact, MacOS is shipped with fonts including broken GX/AAT tables, but
|
||||
no harmful effects due to `officially broken' fonts are observed by
|
||||
end-users.
|
||||
|
||||
gxvalid is designed to continue the validation process as long as
|
||||
possible. When gxvalid find wrong values, gxvalid warns it at least,
|
||||
and takes a fallback procedure if possible. The fallback procedure
|
||||
depends on the debug level.
|
||||
|
||||
We used the following three tools to investigate Apple's error handling.
|
||||
|
||||
- FontValidator (for MacOS 8.5 - 9.2) resource fork font
|
||||
- ftxvalidator (for MacOS X 10.1 -) dfont or naked-sfnt
|
||||
- ftxdumperfuser (for MacOS X 10.1 -) dfont or naked-sfnt
|
||||
|
||||
However, all tests were done on a PowerPC based Macintosh; at present,
|
||||
we have not checked those tools on a m68k-based Macintosh.
|
||||
|
||||
In total, we checked 183 fonts bundled to MacOS 9.1, MacOS 9.2, MacOS
|
||||
10.0, MacOS X 10.1, MSIE for MacOS, and AppleWorks 6.0. These fonts
|
||||
are distributed officially, but many broken GX/AAT tables were found
|
||||
by Apple's font tools. In the following, we list typical violation of
|
||||
the GX specification, in fonts officially distributed with those Apple
|
||||
systems.
|
||||
|
||||
4-1. broken BinSrchHeader (19/183)
|
||||
----------------------------------
|
||||
|
||||
`BinSrchHeader' is a header of a data array for m68k platforms to
|
||||
access memory efficiently. Although there are only two independent
|
||||
parameters for real (`unitSize' and `nUnits'), BinSrchHeader has
|
||||
three additional parameters which can be calculated from `unitSize'
|
||||
and `nUnits', for fast setup. Apple font tools ignore them
|
||||
silently, so gxvalid warns if it finds and inconsistency, and always
|
||||
continues validation. The additional parameters are ignored
|
||||
regardless of the consistency.
|
||||
|
||||
19 fonts include such inconsistencies; all breaks are in the
|
||||
BinSrchHeader structure of the `kern' table.
|
||||
|
||||
4-2. too-short LookupTable (5/183)
|
||||
----------------------------------
|
||||
|
||||
LookupTable format 0 is a simple array to get a value from a given
|
||||
GID (glyph ID); the index of this array is a GID too. Therefore,
|
||||
the length of the array is expected to be same as the maximum GID
|
||||
value defined in the `maxp' table, but there are some fonts whose
|
||||
LookupTable format 0 is too short to cover all GIDs. FontValidator
|
||||
ignores this error silently, ftxvalidator and ftxdumperfuser both
|
||||
warn and continue. Similar problems are found in format 3 subtables
|
||||
of `kern'. gxvalid warns always and abort if the validation level
|
||||
is set to FT_VALIDATE_PARANOID.
|
||||
|
||||
5 fonts include too-short kern format 0 subtables.
|
||||
1 font includes too-short kern format 3 subtable.
|
||||
|
||||
4-3. broken LookupTable format 2 (1/183)
|
||||
----------------------------------------
|
||||
|
||||
LookupTable format 2, subformat 4 covers the GID space by a
|
||||
collection of segments which are specified by `firstGlyph' and
|
||||
`lastGlyph'. Some fonts store `firstGlyph' and `lastGlyph' in
|
||||
reverse order, so the segment specification is broken. Apple font
|
||||
tools ignore this error silently; a broken segment is ignored as if
|
||||
it did not exist. gxvalid warns and normalize the segment at
|
||||
FT_VALIDATE_DEFAULT, or ignore the segment at FT_VALIDATE_TIGHT, or
|
||||
abort at FT_VALIDATE_PARANOID.
|
||||
|
||||
1 font includes broken LookupTable format 2, in the `just' table.
|
||||
|
||||
*) It seems that all fonts manufactured by ITC for AppleWorks have
|
||||
this error.
|
||||
|
||||
4-4. bad bracketing in glyph property (14/183)
|
||||
----------------------------------------------
|
||||
|
||||
GX/AAT defines a `bracketing' property of the glyphs in the `prop'
|
||||
table, to control layout features of strings enclosed inside and
|
||||
outside of brackets. Some fonts give inappropriate bracket
|
||||
properties to glyphs. Apple font tools warn about this error;
|
||||
gxvalid warns too and aborts at FT_VALIDATE_PARANOID.
|
||||
|
||||
14 fonts include wrong bracket properties.
|
||||
|
||||
|
||||
4-5. invalid feature number (117/183)
|
||||
-------------------------------------
|
||||
|
||||
The GX/AAT extension can include 255 different layout features,
|
||||
but popular layout features are predefined (see
|
||||
https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html).
|
||||
Some fonts include feature numbers which are incompatible with the
|
||||
predefined feature registry.
|
||||
|
||||
In our survey, there are 140 fonts including `feat' table.
|
||||
|
||||
a) 67 fonts use a feature number which should not be used.
|
||||
b) 117 fonts set the wrong feature range (nSetting). This is mostly
|
||||
found in the `mort' and `morx' tables.
|
||||
|
||||
Apple font tools give no warning, although they cannot recognize
|
||||
what the feature is. At FT_VALIDATE_DEFAULT, gxvalid warns but
|
||||
continues in both cases (a, b). At FT_VALIDATE_TIGHT, gxvalid warns
|
||||
and aborts for (a), but continues for (b). At FT_VALIDATE_PARANOID,
|
||||
gxvalid warns and aborts in both cases (a, b).
|
||||
|
||||
4-6. invalid prop version (10/183)
|
||||
----------------------------------
|
||||
|
||||
As most TrueType GX tables, the `prop' table must start with a 32bit
|
||||
version identifier: 0x00010000, 0x00020000 or 0x00030000. But some
|
||||
fonts store nonsense binary data instead. When Apple font tools
|
||||
find them, they abort the processing immediately, and the data which
|
||||
follows is unhandled. gxvalid does the same.
|
||||
|
||||
10 fonts include broken `prop' version.
|
||||
|
||||
All of these fonts are classic TrueType fonts for the Japanese
|
||||
script, manufactured by Apple.
|
||||
|
||||
4-7. unknown resource name (2/183)
|
||||
------------------------------------
|
||||
|
||||
NOTE: THIS IS NOT A TRUETYPE GX ERROR.
|
||||
|
||||
If a TrueType font is stored in the resource fork or in dfont
|
||||
format, the data must be tagged as `sfnt' in the resource fork index
|
||||
to invoke TrueType font handler for the data. But the TrueType font
|
||||
data in `Keyboard.dfont' is tagged as `kbd', and that in
|
||||
`LastResort.dfont' is tagged as `lst'. Apple font tools can detect
|
||||
that the data is in TrueType format and successfully validate them.
|
||||
Maybe this is possible because they are known to be dfont. The
|
||||
current implementation of the resource fork driver of FreeType
|
||||
cannot do that, thus gxvalid cannot validate them.
|
||||
|
||||
2 fonts use an unknown tag for the TrueType font resource.
|
||||
|
||||
5. `kern' table issues
|
||||
----------------------
|
||||
|
||||
In common terminology of TrueType, `kern' is classified as a basic and
|
||||
platform-independent table. But there are Apple extensions of `kern',
|
||||
and there is an extension which requires a GX state machine for
|
||||
contextual kerning. Therefore, gxvalid includes a special validator
|
||||
for `kern' tables. Unfortunately, there is no exact algorithm to
|
||||
check Apple's extension, so gxvalid includes a heuristic algorithm to
|
||||
find the proper validation routines for all possible data formats,
|
||||
including the data format for Microsoft. By calling
|
||||
classic_kern_validate() instead of gxv_validate(), you can specify the
|
||||
`kern' format explicitly. However, current FreeType2 uses Microsoft
|
||||
`kern' format only, others are ignored (and should be handled in a
|
||||
library one level higher than FreeType).
|
||||
|
||||
5-1. History
|
||||
------------
|
||||
|
||||
The original 16bit version of `kern' was designed by Apple in the
|
||||
pre-GX era, and it was also approved by Microsoft. Afterwards,
|
||||
Apple designed a new 32bit version of the `kern' table. According
|
||||
to the documentation, the difference between the 16bit and 32bit
|
||||
version is only the size of variables in the `kern' header. In the
|
||||
following, we call the original 16bit version as `classic', and
|
||||
32bit version as `new'.
|
||||
|
||||
5-2. Versions and dialects which should be differentiated
|
||||
---------------------------------------------------------
|
||||
|
||||
The `kern' table consists of a table header and several subtables.
|
||||
The version number which identifies a `classic' or a `new' version
|
||||
is explicitly written in the table header, but there are
|
||||
undocumented differences between Microsoft's and Apple's formats.
|
||||
It is called a `dialect' in the following. There are three cases
|
||||
which should be handled: the new Apple-dialect, the classic
|
||||
Apple-dialect, and the classic Microsoft-dialect. An analysis of
|
||||
the formats and the auto detection algorithm of gxvalid is described
|
||||
in the following.
|
||||
|
||||
5-2-1. Version detection: classic and new kern
|
||||
----------------------------------------------
|
||||
|
||||
According to Apple TrueType specification, there are only two
|
||||
differences between the classic and the new:
|
||||
|
||||
- The `kern' table header starts with the version number.
|
||||
The classic version starts with 0x0000 (16bit),
|
||||
the new version starts with 0x00010000 (32bit).
|
||||
|
||||
- In the `kern' table header, the number of subtables follows
|
||||
the version number.
|
||||
In the classic version, it is stored as a 16bit value.
|
||||
In the new version, it is stored as a 32bit value.
|
||||
|
||||
From Apple font tool's output (DumpKERN is also tested in addition
|
||||
to the three Apple font tools in above), there is another
|
||||
undocumented difference. In the new version, the subtable header
|
||||
includes a 16bit variable named `tupleIndex' which does not exist
|
||||
in the classic version.
|
||||
|
||||
The new version can store all subtable formats (0, 1, 2, and 3),
|
||||
but the Apple TrueType specification does not mention the subtable
|
||||
formats available in the classic version.
|
||||
|
||||
5-2-2. Available subtable formats in classic version
|
||||
----------------------------------------------------
|
||||
|
||||
Although the Apple TrueType specification recommends to use the
|
||||
classic version in the case if the font is designed for both the
|
||||
Apple and Microsoft platforms, it does not document the available
|
||||
subtable formats in the classic version.
|
||||
|
||||
According to the Microsoft TrueType specification, the subtable
|
||||
format assured for Windows and OS/2 support is only subtable
|
||||
format 0. The Microsoft TrueType specification also describes
|
||||
subtable format 2, but does not mention which platforms support
|
||||
it. Subtable formats 1, 3, and higher are documented as reserved
|
||||
for future use. Therefore, the classic version can store subtable
|
||||
formats 0 and 2, at least. `ttfdump.exe', a font tool provided by
|
||||
Microsoft, ignores the subtable format written in the subtable
|
||||
header, and parses the table as if all subtables are in format 0.
|
||||
|
||||
`kern' subtable format 1 uses a StateTable, so it cannot be
|
||||
utilized without a GX State Machine. Therefore, it is reasonable
|
||||
to assume that format 1 (and 3) were introduced after Apple had
|
||||
introduced GX and moved to the new 32bit version.
|
||||
|
||||
5-2-3. Apple and Microsoft dialects
|
||||
-----------------------------------
|
||||
|
||||
The `kern' subtable has a 16bit `coverage' field to describe
|
||||
kerning attributes, but bit interpretations by Apple and Microsoft
|
||||
are different: For example, Apple uses bits 0-7 to identify the
|
||||
subtable, while Microsoft uses bits 8-15.
|
||||
|
||||
In addition, due to the output of DumpKERN and FontValidator,
|
||||
Apple's bit interpretations of coverage in classic and new version
|
||||
are incompatible also. In summary, there are three dialects:
|
||||
classic Apple dialect, classic Microsoft dialect, and new Apple
|
||||
dialect. The classic Microsoft dialect and the new Apple dialect
|
||||
are documented by each vendors' TrueType font specification, but
|
||||
the documentation for classic Apple dialect is not available.
|
||||
|
||||
For example, in the new Apple dialect, bit 15 is documented as
|
||||
`set to 1 if the kerning is vertical'. On the other hand, in
|
||||
classic Microsoft dialect, bit 1 is documented as `set to 1 if the
|
||||
kerning is horizontal'. From the outputs of DumpKERN and
|
||||
FontValidator, classic Apple dialect recognizes 15 as `set to 1
|
||||
when the kerning is horizontal'. From the results of similar
|
||||
experiments, classic Apple dialect seems to be the Endian reverse
|
||||
of the classic Microsoft dialect.
|
||||
|
||||
As a conclusion it must be noted that no font tool can identify
|
||||
classic Apple dialect or classic Microsoft dialect automatically.
|
||||
|
||||
5-2-4. gxvalid auto dialect detection algorithm
|
||||
-----------------------------------------------
|
||||
|
||||
The first 16 bits of the `kern' table are enough to identify the
|
||||
version:
|
||||
|
||||
- if the first 16 bits are 0x0000, the `kern' table is in
|
||||
classic Apple dialect or classic Microsoft dialect
|
||||
- if the first 16 bits are 0x0001, and next 16 bits are 0x0000,
|
||||
the kern table is in new Apple dialect.
|
||||
|
||||
If the `kern' table is a classic one, the 16bit `coverage' field
|
||||
is checked next. Firstly, the coverage bits are decoded for the
|
||||
classic Apple dialect using the following bit masks (this is based
|
||||
on DumpKERN output):
|
||||
|
||||
0x8000: 1=horizontal, 0=vertical
|
||||
0x4000: not used
|
||||
0x2000: 1=cross-stream, 0=normal
|
||||
0x1FF0: reserved
|
||||
0x000F: subtable format
|
||||
|
||||
If any of reserved bits are set or the subtable bits is
|
||||
interpreted as format 1 or 3, we take it as `impossible in classic
|
||||
Apple dialect' and retry, using the classic Microsoft dialect.
|
||||
|
||||
The most popular coverage in new Apple-dialect: 0x8000,
|
||||
The most popular coverage in classic Apple-dialect: 0x0000,
|
||||
The most popular coverage in classic Microsoft dialect: 0x0001.
|
||||
|
||||
5-3. Tested fonts
|
||||
-----------------
|
||||
|
||||
We checked 59 fonts bundled with MacOS and 38 fonts bundled with
|
||||
Windows, where all font include a `kern' table.
|
||||
|
||||
- fonts bundled with MacOS
|
||||
* new Apple dialect
|
||||
format 0: 18
|
||||
format 2: 1
|
||||
format 3: 1
|
||||
* classic Apple dialect
|
||||
format 0: 14
|
||||
* classic Microsoft dialect
|
||||
format 0: 15
|
||||
|
||||
- fonts bundled with Windows
|
||||
* classic Microsoft dialect
|
||||
format 0: 38
|
||||
|
||||
It looks strange that classic Microsoft-dialect fonts are bundled to
|
||||
MacOS: they come from MSIE for MacOS, except of MarkerFelt.dfont.
|
||||
|
||||
|
||||
ACKNOWLEDGEMENT
|
||||
---------------
|
||||
|
||||
Some parts of gxvalid are derived from both the `gxlayout' module and
|
||||
the `otvalid' module. Development of gxlayout was supported by the
|
||||
Information-technology Promotion Agency(IPA), Japan.
|
||||
|
||||
The detailed analysis of undefined glyph ID utilization in `mort' and
|
||||
`morx' tables is provided by George Williams.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Copyright (C) 2004-2022 by
|
||||
suzuki toshiya, 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.
|
||||
|
||||
|
||||
--- end of README ---
|
|
@ -1,22 +0,0 @@
|
|||
Name: zlib
|
||||
Short Name: zlib
|
||||
URL: http://zlib.net/
|
||||
Version: 1.2.12
|
||||
License: see `zlib.h`
|
||||
|
||||
Description:
|
||||
"A massively spiffy yet delicately unobtrusive compression library."
|
||||
|
||||
'zlib' is a free, general-purpose, legally unencumbered lossless
|
||||
data-compression library. 'zlib' implements the "deflate" compression
|
||||
algorithm described by RFC 1951, which combines the LZ77 (Lempel-Ziv)
|
||||
algorithm with Huffman coding. zlib also implements the zlib (RFC 1950) and
|
||||
gzip (RFC 1952) wrapper formats.
|
||||
|
||||
Local Modifications:
|
||||
The files in this directory have been prepared as follows.
|
||||
|
||||
- Take the unmodified source code files from the zlib distribution that are
|
||||
included by `ftgzip.c`.
|
||||
- Run zlib's `zlib2ansi` script on all `.c` files.
|
||||
- Apply the diff file(s) in the `patches` folder.
|
|
@ -1,372 +0,0 @@
|
|||
[zlib] Fix zlib sources for compilation with FreeType
|
||||
|
||||
We must ensure that they do not issue compiler errors or warnings when they
|
||||
are compiled as part of `src/gzip/ftgzip.c`.
|
||||
|
||||
* src/gzip/adler32.c: Do not define unused functions when `Z_FREETYPE`
|
||||
is set.
|
||||
|
||||
* src/gzip/gzguts.h (COPY): Rename to...
|
||||
(COPY__): ... this since `COPY` and `COPY_` conflict with enum values,
|
||||
which have the same name in `zlib.h`.
|
||||
|
||||
* src/gzip/inflate.c, src/gzip/adler32.c: Omit unused function
|
||||
declarations when `Z_FREETYPE` is defined.
|
||||
|
||||
* src/gzip/zlib.h: Include `ftzconf.h` instead of `zconf.h` to avoid
|
||||
conflicts with system-installed headers.
|
||||
Omit unused function declarations when `Z_FREETYPE` is defined.
|
||||
|
||||
* src/gzip/zutil.h: Use `ft_memxxx` functions instead of `memxxx`.
|
||||
Omit unused function declarations when `Z_FREETYPE` is defined.
|
||||
|
||||
* src/gzip/inflate.h, src/gzip/inftrees.h: Add header guard macros to
|
||||
prevent compiler errors.
|
||||
|
||||
diff --git a/src/gzip/adler32.c b/src/gzip/adler32.c
|
||||
index be5e8a247..aa032e1dd 100644
|
||||
--- a/src/gzip/adler32.c
|
||||
+++ b/src/gzip/adler32.c
|
||||
@@ -7,7 +7,9 @@
|
||||
|
||||
#include "zutil.h"
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
|
||||
+#endif
|
||||
|
||||
#define BASE 65521U /* largest prime smaller than 65536 */
|
||||
#define NMAX 5552
|
||||
@@ -139,6 +141,8 @@ uLong ZEXPORT adler32(
|
||||
return adler32_z(adler, buf, len);
|
||||
}
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
/* ========================================================================= */
|
||||
local uLong adler32_combine_(
|
||||
uLong adler1,
|
||||
@@ -184,3 +188,5 @@ uLong ZEXPORT adler32_combine64(
|
||||
{
|
||||
return adler32_combine_(adler1, adler2, len2);
|
||||
}
|
||||
+
|
||||
+#endif /* !Z_FREETYPE */
|
||||
diff --git a/src/gzip/gzguts.h b/src/gzip/gzguts.h
|
||||
index 57faf3716..4f09a52a7 100644
|
||||
--- a/src/gzip/gzguts.h
|
||||
+++ b/src/gzip/gzguts.h
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
/* values for gz_state how */
|
||||
#define LOOK 0 /* look for a gzip header */
|
||||
-#define COPY 1 /* copy input directly */
|
||||
+#define COPY__ 1 /* copy input directly */
|
||||
#define GZIP 2 /* decompress a gzip stream */
|
||||
|
||||
/* internal gzip file state data structure */
|
||||
diff --git a/src/gzip/inflate.c b/src/gzip/inflate.c
|
||||
index 4375557b4..5bf5b815e 100644
|
||||
--- a/src/gzip/inflate.c
|
||||
+++ b/src/gzip/inflate.c
|
||||
@@ -99,8 +99,10 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
|
||||
#ifdef BUILDFIXED
|
||||
void makefixed OF((void));
|
||||
#endif
|
||||
+#ifndef Z_FREETYPE
|
||||
local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
|
||||
unsigned len));
|
||||
+#endif
|
||||
|
||||
local int inflateStateCheck(
|
||||
z_streamp strm)
|
||||
@@ -245,6 +247,8 @@ int ZEXPORT inflateInit_(
|
||||
return inflateInit2_(strm, DEF_WBITS, version, stream_size);
|
||||
}
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
int ZEXPORT inflatePrime(
|
||||
z_streamp strm,
|
||||
int bits,
|
||||
@@ -266,6 +270,8 @@ int ZEXPORT inflatePrime(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
+#endif /* !Z_FREETYPE */
|
||||
+
|
||||
/*
|
||||
Return state with length and distance decoding tables and index sizes set to
|
||||
fixed code decoding. Normally this returns fixed tables from inffixed.h.
|
||||
@@ -1312,6 +1318,8 @@ int ZEXPORT inflateEnd(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
int ZEXPORT inflateGetDictionary(
|
||||
z_streamp strm,
|
||||
Bytef *dictionary,
|
||||
@@ -1471,6 +1479,8 @@ int ZEXPORT inflateSync(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
+#endif /* !Z_FREETYPE */
|
||||
+
|
||||
/*
|
||||
Returns true if inflate is currently at the end of a block generated by
|
||||
Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
|
||||
@@ -1489,6 +1499,8 @@ int ZEXPORT inflateSyncPoint(
|
||||
return state->mode == STORED && state->bits == 0;
|
||||
}
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
int ZEXPORT inflateCopy(
|
||||
z_streamp dest,
|
||||
z_streamp source)
|
||||
@@ -1536,6 +1548,8 @@ int ZEXPORT inflateCopy(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
+#endif /* !Z_FREETYPE */
|
||||
+
|
||||
int ZEXPORT inflateUndermine(
|
||||
z_streamp strm,
|
||||
int subvert)
|
||||
@@ -1569,6 +1583,8 @@ int ZEXPORT inflateValidate(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
long ZEXPORT inflateMark(
|
||||
z_streamp strm)
|
||||
{
|
||||
@@ -1590,3 +1606,5 @@ unsigned long ZEXPORT inflateCodesUsed(
|
||||
state = (struct inflate_state FAR *)strm->state;
|
||||
return (unsigned long)(state->next - state->codes);
|
||||
}
|
||||
+
|
||||
+#endif /* !Z_FREETYPE */
|
||||
diff --git a/src/gzip/inflate.h b/src/gzip/inflate.h
|
||||
index f127b6b1f..c6f5a52e1 100644
|
||||
--- a/src/gzip/inflate.h
|
||||
+++ b/src/gzip/inflate.h
|
||||
@@ -3,6 +3,9 @@
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
+#ifndef INFLATE_H
|
||||
+#define INFLATE_H
|
||||
+
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
@@ -124,3 +127,5 @@ struct inflate_state {
|
||||
int back; /* bits back of last unprocessed length/lit */
|
||||
unsigned was; /* initial length of match */
|
||||
};
|
||||
+
|
||||
+#endif /* INFLATE_H */
|
||||
diff --git a/src/gzip/inftrees.h b/src/gzip/inftrees.h
|
||||
index baa53a0b1..c94eb78b5 100644
|
||||
--- a/src/gzip/inftrees.h
|
||||
+++ b/src/gzip/inftrees.h
|
||||
@@ -3,6 +3,9 @@
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
+#ifndef INFTREES_H
|
||||
+#define INFTREES_H
|
||||
+
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
@@ -60,3 +63,5 @@ typedef enum {
|
||||
int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
|
||||
unsigned codes, code FAR * FAR *table,
|
||||
unsigned FAR *bits, unsigned short FAR *work));
|
||||
+
|
||||
+#endif /* INFTREES_H_ */
|
||||
diff --git a/src/gzip/zlib.h b/src/gzip/zlib.h
|
||||
index 4a98e38bf..d760140c2 100644
|
||||
--- a/src/gzip/zlib.h
|
||||
+++ b/src/gzip/zlib.h
|
||||
@@ -31,7 +31,7 @@
|
||||
#ifndef ZLIB_H
|
||||
#define ZLIB_H
|
||||
|
||||
-#include "zconf.h"
|
||||
+#include "ftzconf.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -211,6 +211,8 @@ typedef gz_header FAR *gz_headerp;
|
||||
|
||||
#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
#define zlib_version zlibVersion()
|
||||
/* for compatibility with versions < 1.0.2 */
|
||||
|
||||
@@ -246,7 +248,6 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
|
||||
this will be done by deflate().
|
||||
*/
|
||||
|
||||
-
|
||||
ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
|
||||
/*
|
||||
deflate compresses as much data as possible, and stops when the input
|
||||
@@ -373,6 +374,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
|
||||
deallocated).
|
||||
*/
|
||||
|
||||
+#endif /* !Z_FREETYPE */
|
||||
|
||||
/*
|
||||
ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
|
||||
@@ -534,6 +536,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
|
||||
The following functions are needed only in some special applications.
|
||||
*/
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
/*
|
||||
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||
int level,
|
||||
@@ -956,6 +960,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
|
||||
destination.
|
||||
*/
|
||||
|
||||
+#endif /* !Z_FREETYPE */
|
||||
+
|
||||
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
|
||||
/*
|
||||
This function is equivalent to inflateEnd followed by inflateInit,
|
||||
@@ -980,6 +986,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
|
||||
the windowBits parameter is invalid.
|
||||
*/
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
|
||||
int bits,
|
||||
int value));
|
||||
@@ -1069,6 +1077,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
|
||||
stream state was inconsistent.
|
||||
*/
|
||||
|
||||
+#endif /* !Z_FREETYPE */
|
||||
+
|
||||
/*
|
||||
ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
|
||||
unsigned char FAR *window));
|
||||
@@ -1095,6 +1105,8 @@ typedef unsigned (*in_func) OF((void FAR *,
|
||||
z_const unsigned char FAR * FAR *));
|
||||
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
|
||||
in_func in, void FAR *in_desc,
|
||||
out_func out, void FAR *out_desc));
|
||||
@@ -1214,6 +1226,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
|
||||
27-31: 0 (reserved)
|
||||
*/
|
||||
|
||||
+#endif /* !Z_FREETYPE */
|
||||
+
|
||||
#ifndef Z_SOLO
|
||||
|
||||
/* utility functions */
|
||||
@@ -1742,6 +1756,8 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||
if (crc != original_crc) error();
|
||||
*/
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||
z_size_t len));
|
||||
/*
|
||||
@@ -1822,6 +1838,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
|
||||
ZLIB_VERSION, (int)sizeof(z_stream))
|
||||
#endif
|
||||
|
||||
+#else /* Z_FREETYPE */
|
||||
+
|
||||
+
|
||||
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
|
||||
+ const char *version, int stream_size));
|
||||
+
|
||||
+# define inflateInit2(strm, windowBits) \
|
||||
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
|
||||
+ (int)sizeof(z_stream))
|
||||
+
|
||||
+#endif /* Z_FREETYPE */
|
||||
+
|
||||
+
|
||||
#ifndef Z_SOLO
|
||||
|
||||
/* gzgetc() macro and its supporting function and exposed data structure. Note
|
||||
@@ -1901,13 +1930,16 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||
|
||||
#else /* Z_SOLO */
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||
+#endif
|
||||
|
||||
#endif /* !Z_SOLO */
|
||||
|
||||
/* undocumented functions */
|
||||
+#ifndef Z_FREETYPE
|
||||
ZEXTERN const char * ZEXPORT zError OF((int));
|
||||
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
|
||||
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
|
||||
@@ -1927,6 +1959,7 @@ ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
|
||||
va_list va));
|
||||
# endif
|
||||
#endif
|
||||
+#endif /* !Z_FREETYPE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
diff --git a/src/gzip/zutil.h b/src/gzip/zutil.h
|
||||
index d9a20ae1b..14f0f1a85 100644
|
||||
--- a/src/gzip/zutil.h
|
||||
+++ b/src/gzip/zutil.h
|
||||
@@ -188,6 +188,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
#pragma warn -8066
|
||||
#endif
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
/* provide prototypes for these when building zlib without LFS */
|
||||
#if !defined(_WIN32) && \
|
||||
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
||||
@@ -195,6 +197,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||
#endif
|
||||
|
||||
+#endif /* !Z_FREETYPE */
|
||||
+
|
||||
/* common defaults */
|
||||
|
||||
#ifndef OS_CODE
|
||||
@@ -226,9 +230,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
# define zmemcmp _fmemcmp
|
||||
# define zmemzero(dest, len) _fmemset(dest, 0, len)
|
||||
# else
|
||||
-# define zmemcpy memcpy
|
||||
-# define zmemcmp memcmp
|
||||
-# define zmemzero(dest, len) memset(dest, 0, len)
|
||||
+# define zmemcpy ft_memcpy
|
||||
+# define zmemcmp ft_memcmp
|
||||
+# define zmemzero(dest, len) ft_memset(dest, 0, len)
|
||||
# endif
|
||||
#else
|
||||
void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
|
|
@ -1,96 +0,0 @@
|
|||
FreeType font driver for PCF fonts
|
||||
|
||||
Francesco Zappa Nardelli
|
||||
<francesco.zappa.nardelli@ens.fr>
|
||||
|
||||
|
||||
Introduction
|
||||
************
|
||||
|
||||
PCF (Portable Compiled Format) is a binary bitmap font format, largely used
|
||||
in X world. This code implements a PCF driver for the FreeType library.
|
||||
Glyph images are loaded into memory only on demand, thus leading to a small
|
||||
memory footprint.
|
||||
|
||||
Information on the PCF font format can only be worked out from
|
||||
`pcfread.c', and `pcfwrite.c', to be found, for instance, in the XFree86
|
||||
(www.xfree86.org) source tree (xc/lib/font/bitmap/).
|
||||
|
||||
Many good bitmap fonts in bdf format come with XFree86: they can be
|
||||
compiled into the pcf format using the `bdftopcf' utility.
|
||||
|
||||
|
||||
Supported hardware
|
||||
******************
|
||||
|
||||
The driver has been tested on linux/x86 and sunos5.5/sparc. In both
|
||||
cases the compiler was gcc. When back in Paris, I will test it also
|
||||
on linux/alpha.
|
||||
|
||||
|
||||
Encodings
|
||||
*********
|
||||
|
||||
Use `FT_Get_BDF_Charset_ID' to access the encoding and registry.
|
||||
|
||||
The driver always exports `ft_encoding_none' as face->charmap.encoding.
|
||||
FT_Get_Char_Index() behavior is unmodified, that is, it converts the ULong
|
||||
value given as argument into the corresponding glyph number.
|
||||
|
||||
|
||||
Known problems
|
||||
**************
|
||||
|
||||
- dealing explicitly with encodings breaks the uniformity of FreeType 2
|
||||
API.
|
||||
|
||||
- except for encodings properties, client applications have no
|
||||
visibility of the PCF_Face object. This means that applications
|
||||
cannot directly access font tables and are obliged to trust
|
||||
FreeType.
|
||||
|
||||
- currently, glyph names and ink_metrics are ignored.
|
||||
|
||||
I plan to give full visibility of the PCF_Face object in the next
|
||||
release of the driver, thus implementing also glyph names and
|
||||
ink_metrics.
|
||||
|
||||
- height is defined as (ascent - descent). Is this correct?
|
||||
|
||||
- if unable to read size information from the font, PCF_Init_Face
|
||||
sets available_size->width and available_size->height to 12.
|
||||
|
||||
- too many english grammar errors in the readme file :-(
|
||||
|
||||
|
||||
License
|
||||
*******
|
||||
|
||||
Copyright (C) 2000 by Francesco Zappa Nardelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
Credits
|
||||
*******
|
||||
|
||||
Keith Packard wrote the pcf driver found in XFree86. His work is at
|
||||
the same time the specification and the sample implementation of the
|
||||
PCF format. Undoubtedly, this driver is inspired from his work.
|
|
@ -1,73 +0,0 @@
|
|||
#
|
||||
# FreeType 2 psnames driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright (C) 1996-2022 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.
|
||||
|
||||
|
||||
# psnames driver directory
|
||||
#
|
||||
PSNAMES_DIR := $(SRC_DIR)/psnames
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
PSNAMES_COMPILE := $(CC) $(ANSIFLAGS) \
|
||||
$I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR)) \
|
||||
$(INCLUDE_FLAGS) \
|
||||
$(FT_CFLAGS)
|
||||
|
||||
|
||||
# psnames driver sources (i.e., C files)
|
||||
#
|
||||
PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c
|
||||
|
||||
|
||||
# psnames driver headers
|
||||
#
|
||||
PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
|
||||
$(PSNAMES_DIR)/psnamerr.h \
|
||||
$(PSNAMES_DIR)/pstables.h
|
||||
|
||||
|
||||
# psnames driver object(s)
|
||||
#
|
||||
# PSNAMES_DRV_OBJ_M is used during `multi' builds
|
||||
# PSNAMES_DRV_OBJ_S is used during `single' builds
|
||||
#
|
||||
PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O
|
||||
|
||||
# psnames driver source file for single build
|
||||
#
|
||||
PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psnames.c
|
||||
|
||||
|
||||
# psnames driver - single object
|
||||
#
|
||||
$(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \
|
||||
$(FREETYPE_H) $(PSNAMES_DRV_H)
|
||||
$(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S))
|
||||
|
||||
|
||||
# psnames driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H)
|
||||
$(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
|
@ -1,23 +0,0 @@
|
|||
#
|
||||
# FreeType 2 renderer module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright (C) 1996-2022 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += RASTER_MODULE
|
||||
|
||||
define RASTER_MODULE
|
||||
$(OPEN_DRIVER) FT_Renderer_Class, ft_raster1_renderer_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
Loading…
Reference in New Issue