Commit Graph

99 Commits

Author SHA1 Message Date
David Turner a212668c9f Remove obsolete AF_Angle type and related sources.
Move the af_sort_xxx() functions from afangles.c to afhints.c
in order to get rid of the obsolete angle-related types,
macros and function definitions.
2021-07-12 09:25:39 +02:00
David Turner 2f11522a2a Remove experimental auto-hinting 'warp' mode.
This feature was always experimental, and probably nevery worked
properly. This patch completely removes it from the source code,
except for a documentation block describing it for historical
purpose.
2021-07-12 09:25:22 +02:00
Werner Lemberg b6e8a71266 Update all copyright notices. 2021-01-17 07:18:48 +01:00
Werner Lemberg 1658685967 Remove redundant inclusion of `ft2build.h'.
* */*: Remove `#include <ft2build.h>' where possible.

* include/freetype/freetype.h: Remove cpp error about missing
inclusion of `ft2build.h'.
2020-06-13 21:15:45 +02:00
David Turner e13391333f Make macros for header file names optional.
We no longer have to take care of the 8.3 file name limit; this
allows us (a) to introduce longer, meaningful file names, and (b) to
avoid macro names in `#include' lines altogether since some
compilers (most notably Visual C++) doesn't support this properly.

*/*: Replace

   #include FOO_H

with

   #include <freetype/foo.h>

or something similar.  Also update the documentation.
2020-06-08 13:31:55 +02:00
Werner Lemberg e5038be704 Update all copyright notices. 2020-01-19 17:05:19 +01:00
Werner Lemberg 7585997024 Update all copyright notices. 2019-02-23 10:07:09 +01:00
Werner Lemberg f686ad46a3 Update copyright years. 2019-01-22 20:31:44 +01:00
Werner Lemberg 9ac9060df0 [GSoC] src/*.*: Convert block comments to `light' style.
This monster commit was created by applying Nikhil's scripts
`docconverter.py' and `markify.py' to all C header and source files,
followed up by minor manual clean-up.

No change in functionality, of course.

I used commit f7419907bc6044b9b7057f9789866426c804ba82 from
https://github.com/nikramakrishnan/freetype-docs.git.
2018-06-03 09:08:41 +02:00
Werner Lemberg 9514959241 Remove FT_CONFIG_OPTION_PIC and related code.
*/* [FT_CONFIG_OPTION_PIC]: Remove all code guarded by this
preprocessor symbol.

*/*: Replace `XXX_GET' macros (which could be either a function in
PIC mode or an array in non-PIC mode) with `xxx' arrays.

* include/freetype/internal/ftpic.h, src/autofit/afpic.c,
src/autofit/afpic.h, src/base/basepic.c, src/base/basepic.h,
src/base/ftpic.c, src/cff/cffpic.c, src/cff/cffpic.h,
src/pshinter/pshpic.c, src/pshinter/pshpic.h, src/psnames/pspic.c,
src/psnames/pspic.h, src/raster/rastpic.c, src/raster/rastpic.h,
src/sfnt/sfntpic.c, src/sfnt/sfntpic.h, src/smooth/ftspic.c,
src/smooth/ftspic.h, src/truetype/ttpic.c, src/truetype/ttpic.h:
Removed.
2018-05-02 20:27:48 +02:00
Werner Lemberg 63aaf89cec s/sub-pixel/subpixel/. 2018-02-17 10:34:47 +01:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Werner Lemberg dadc50a467 Make compilation with FT_CONFIG_OPTION_PIC work again.
All code committed here is guarded with `FT_CONFIG_OPTION_PIC'.

* include/freetype/internal/services/svmetric.h
(FT_DEFINE_SERVICE_METRICSVARIATIONSREC): Remove trailing semicolon.

* src/autofit/aflatin.c (af_latin_hints_compute_edges,
af_latin_hint_edges): Provide `globals' variable.

* src/autofit/afloader.c (af_loader_load_glyph): Remove shadowing
variable.

* src/autofit/afmodule.c (AF_SCRIPT_CLASSES_GET,
AF_STYLE_CLASSES_GET): Redefine.

* src/autofit/aftypes.h (AF_DEFINE_WRITING_SYSTEM_CLASS): Fix typo.

* src/cff/cffparse.c (CFF_FIELD_BLEND): Provide it.

* src/cff/cffpic.h (CffModulePIC): Fix typo.
2017-02-02 07:13:29 +01:00
Werner Lemberg 563ae78022 Update copyright year. 2017-01-04 20:16:34 +01:00
Oleksandr Chekhovskyi 255828c891 [autofit] Fix Emscripten crash (patch #9180).
Function calls through pointers must use a matching signature to
work on Emscripten, since such calls are dispatched through lookup
tables grouped by signature.

* src/autofit/aftypes.h (AF_WritingSystem_ApplyHintsFunc): Fix
typedef.
2016-12-01 07:07:22 +01:00
Alexei Podtelezhnikov e85422606d Typos. 2016-04-08 23:21:34 -04:00
Werner Lemberg 9adeab6452 Update copyright year. 2016-01-13 11:54:10 +01:00
Werner Lemberg 37412ff9f4 Don't use macro names that contain `__' [1/2].
Such macro names are reserved for both C and C++.

*/*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
2016-01-12 21:37:13 +01:00
Werner Lemberg 172db3254c [autofit] Add hinting direction to `AF_ScriptClassRec'.
Still unused.

* src/autofit/afglobal.c (SCRIPT): Handle hinting direction.

* src/autofit/aftypes.h (AF_ScriptClassRec): Add
`top_to_bottom_hinting' field.
(AF_HINTING_BOTTOM_TO_TOP, AF_HINTING_TOP_TO_BOTTOM): New macros.
(AF_DEFINE_SCRIPT_CLASS): Updated.
2015-12-24 08:17:51 +01:00
Werner Lemberg b0de5a82f1 [autofit] Start implementing hinting direction (up/down, down/up).
Right now, it does nothing.

* src/autofit/afscript.h: Add another parameter to `SCRIPT',
specifying hinting direction.

* src/autofit/afglobal.c, scr/autofit/afglobal.h,
src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/afshaper.c,
src/autofit/aftypes.h: Extend `SCRIPT' definitions.
2015-12-23 23:25:03 +01:00
Werner Lemberg f45c0bf963 [autofit] Use string of standard characters.
This is more flexible; additionally, it would allow character
clusters.

* src/autofit/aftypes.h (SCRIPT, AF_DEFINE_SCRIPT_CLASS): Updated.
(AF_ScriptClassRec): Replace `standard_char[123]' with
`standard_charstring'.

* src/autofit/afscript.h: Replace last three character arguments
of the `SCRIPT' calls with a string parameter, holding the standard
characters (in UTF-8 encoding) separated with spaces.

* src/autofit/afglobal.c, src/autofit/afglobal.h,
src/autofit/afpic.c, src/autofit/afranges.c, src/autofit/hbshim.c
(SCRIPT): Updated.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths): Updated.
2015-12-06 09:58:18 +01:00
Nikolaus Waxweiler 37c401ac0a [autofit] Add functions to get standard widths for writing systems.
We need the computed standard horizontal and vertical widths for the
emboldening calculation.  This method provides a convenient way to
extract it from writing-system-specific metrics structures, which
all script definitions must implement.

* src/autofit/aftypes.h (AF_WritingSystem_GetStdWidthsFunc): New
function type.
(AF_WritingSystemClassRec): New member `style_metrics_getstdw'.
(AF_DEFINE_WRITING_SYSTEM_CLASS): Updated.

* src/autofit/afcjk.c (af_cjk_get_standard_width): New function.
(af_cjk_writing_system_class): Updated.
* src/autofit/afdummy.c	(af_dummy_writing_system_class): Updated.
* src/autofit/afindic.c (af_cjk_get_standard_width): New function.
(af_indic_writing_system_class): Updated.
* src/autofit/aflatin.c (af_latin_get_standard_width): New function.
(af_indic_writing_system_class): Updated.
* src/autofit/aflatin.c (af_latin_get_standard_width): New function.
(af_indic_writing_system_class): Updated.
2015-11-02 09:32:26 +01:00
Werner Lemberg dbd04269dc [autofit] Replace `no-base' with `non-base'.
* src/autofit/*: Do it.
2015-09-30 17:52:42 +02:00
Werner Lemberg d3cba0ed30 [autofit] Redesign code ranges (2/2).
This commit adds two fallback scripts (`latb', `latp') and
implements support for the no-base character ranges introduced in
the previous commit.

* src/autofit/aftypes.h (AF_ScriptClassRec): Add
`script_uni_nobase_ranges' field.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/afscript.h, src/autofit/afstyles.h: Add `latb' and
`latp' fallback scripts.

* src/autofit/afblue.dat: Add blue zones for Latin subscript and
superscript fallback scripts.

* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/afglobal.h (AF_NOBASE): New style flag for no-base
characters.
(AF_STYLE_MASK): Updated.

* src/autofit/afglobal.c (SCRIPT): Updated.
(af_face_globals_compute_style_coverage): Handle new style flag.

* src/autofit/aflatin.c (af_latin_hints_apply): Handle new style
flag.

* src/autofit/afranges.h (SCRIPT): Use it to export no-base ranges.
2015-09-04 10:28:53 +02:00
Werner Lemberg 8cbbcf6b98 [autofit] Pass glyph index to hinting function.
No functionality change yet.

* src/autofit/aftypes.h (AF_WritingSystem_ApplyHintsFunc): Pass
glyph index.

* src/autofit/afcjk.c, src/autofit/afcjk.h (af_cjk_hints_apply),
src/autofit/afdummy.c (af_dummy_hints_apply), src/autofit/afindic.c
(af_indic_hints_apply), src/autofit/aflatin.c
(af_latin_hints_apply), src/autofit/aflatin2.c
(af_latin2_hints_apply), src/autofit/afloader.c (af_loader_load_g):
Updated.
2015-09-03 06:47:30 +02:00
Werner Lemberg f9be567f5f Better support of user-supplied C++ namespaces.
See

  http://lists.nongnu.org/archive/html/freetype-devel/2015-07/msg00008.html

for a rationale.

* src/autofit/afpic.h, src/base/basepic.h, src/cff/cffpic.h,
src/pshinter/pshpic.h, src/psnames/pspic.h, src/raster/rastpic.h,
src/sfnt/sfntpic.h, src/smooth/ftspic.h, src/truetype/ttpic.h
(FT_BEGIN_HEADER, FT_END_HEADER): Move macro calls to not enclose
header files that contain FT_{BEGIN,END}_HEADER macros by
themselves.

* src/autofit/aftypes.h [FT_DEBUG_AUTOFIT]: Include
FT_CONFIG_STANDARD_LIBRARY_H earlier.

* src/truetype/ttpic.h: Include FT_INTERNL_PIC_H.
2015-07-09 15:10:31 +02:00
Werner Lemberg 12661a5ae0 [autofit] Introduce `warping' property.
This code replaces the debugging hook from the previous commit with
a better, more generic solution.

* include/ftautoh.h: Document it.

* src/autofit/afmodule.h (AF_ModuleRec)
[AF_CONFIG_OPTION_USE_WARPER]: Add `warping' field.

* src/autofit/afmodule.c (_af_debug_disable_warper): Remove.
(af_property_set, af_property_get, af_autofitter_init)
[AF_CONFIG_OPTION_USE_WARPER]: Handle `warping' option.

* src/autofit/afhints.h (AF_HINTS_DO_WARP): Remove use of the no
longer existing `_af_debug_disable_warper'.

* src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
(af_latin_hints_init), src/autofit/aflatin2.c (af_latin2_hints_init)
[AF_CONFIG_OPTION_USE_WARPER]: Add `AF_SCALER_FLAG_NO_WARPER' to the
scaler flags if warping is off.

* src/autofit/aftypes.h: Updated.
2015-04-21 07:13:59 +02:00
Werner Lemberg 58f48f0ddc [autofit] Add debugging hook to disable warper.
* src/autofit/afmodule.c (_af_debug_disable_warper)
[FT_DEBUG_AUTOFIT]: New global variable.

* src/autofit/aftypes.h: Updated.
(AF_SCALER_FLAG_NO_WARPER): New macro (not actively used yet).

* src/autofit/afhints.h (AF_HINTS_DO_WARP): New macro.

* src/autofi/aflatin.c (af_latin_hints_apply)
[AF_CONFIG_OPTION_USE_WARPER]: Use `AF_HINTS_DO_WARP' to control use
of warper.

* src/autofit/afcjk.c (af_cjk_hints_init, af_cjk_hints_apply)
[AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'.

* src/autofit/aflatin2.c (af_latin2_hints_apply)
[AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'.
2015-04-16 20:11:49 +02:00
Alexei Podtelezhnikov dac5644cea [base] Optimize `FT_Angle_Diff'.
Under normal circumstances we are usually close to the desired range
of angle values, so that the remainder is not really necessary.

* src/base/fttrigon.c (FT_Angle_Diff): Use loops instead of remainder.

* src/autofit/aftypes.h (AF_ANGLE_DIFF): Ditto in the unused macro.
2015-03-21 23:30:16 -04:00
Werner Lemberg 81e5ff53a8 [autofit] Use macros for (unsigned) flags, not enumerations.
This harmonizes with other code in FreeType (and reduces the number
of necessary casts to avoid compiler warnings).

* src/autofit/afblue.hin: Make flag macros unsigned.
* src/autofit/afblue.h: Regenerated.

* src/autofit/afcjk.h: Replace flag enumeration with macros.
* src/autofit/afcjk.c: Updated.

* src/autofit/afhints.h (AF_Flags, AF_Edge_Flags): Replace with
macros.
* src/autofit/afhints.c: Updated.

* src/autofit/aflatin.h: Replace flag enumerations with macros.
* src/autofit/aflatin.c, src/autofit/aflatin2.c: Updated.

* src/autofit/aftypes.h (AF_ScalerFlags): Replace with macros.
2015-02-19 09:46:48 +01:00
Werner Lemberg f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg a336400112 [autofit] Introduce two more slots for standard characters.
This is useful for OpenType features like `c2sc' (caps to small
caps) that don't have lowercase letters by definition, or other
features that mainly operate on numerals.

* src/autofit/afscript.h: Add more standard characters.

* src/autofit/aftypes.h: Update use of `SCRIPT' macro.
(AF_ScriptClassRec): Add members to hold two more standard
characters.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/afglobal.c, src/autofit/afglobal.h,
* src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/hbshim.c:
Update use of `SCRIPT' macro.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths): Scan two more
standard characters.
2014-01-26 09:45:23 +01:00
Werner Lemberg 2b623fe4f6 Minor doc issues. 2014-01-15 09:46:23 +01:00
Werner Lemberg 44aa7e0af5 [autofit] Don't combine multiple features into one set.
Combining them, as originally envisioned, would lead to much more
complicated code, as investigations have shown meanwhile.  The major
drawback is that we run out of available style slots much earlier.
However, this is only a theoretical issue since we don't support a
large number of scripts currently.

* src/autofit/afcover.h: Replace `COVERAGE_{1,2,3}' macros with
a single-element `COVERAGE' macro, sort the elements by the feature
tags, and add entry for `ruby'.

* src/autofit/aftypes.h: Updated.
* src/autofit/hbshim.c: Updated.
2013-12-30 07:41:22 +01:00
Werner Lemberg 1924134710 Introduce `coverages'.
Coverages are the interface to the HarfBuzz library to access
OpenType features for handling glyphs not addressable by the cmap.

Right now, compilation of HarfBuzz is only added to the development
build.  A solution for standard build mode will be delayed until
HarfBuzz gets split into two libraries to avoid mutual dependencies
between FreeType and HarfBuzz.

Note that this is only a first step in handling coverages, basically
providing the framework only.  Code for handling selected OpenType
features (this is, actually using the data in `afcover.h') will
follow.

* devel/ftoption.h, include/config/ftoption.h
(FT_CONFIG_OPTION_USE_HARFBUZZ): New macro.

* src/autofit/hbshim.c, src/autofit/hbshim.h, src/autofit/afcover.h:
New files.

* src/autofit/afscript.h: Add HarfBuzz script name tags.

* src/autofit/afstyles.h: Add default coverage enumeration values.

* src/autofit/aftypes.h: Update use of `SCRIPT' and `STYLE' macros.
(AF_Coverage): New enumeration (generated by `afcover.h').
(AF_StyleClassRec): New member `coverage'.
(AF_DEFINE_STYLE_CLASS): Updated.

* include/internal/fttrace.h: Add `afharfbuzz' for tracing coverage
data.

* src/autofit/afglobal.h: Update use of `SCRIPT' and `STYLE' macros.
(AF_SCRIPT_FALLBACK): Renamed to ...
(AF_STYLE_FALLBACK): ... this.

* src/autofit/afglobal.c: Include `hbshim.c'.
Update use of `SCRIPT' and `STYLE' macros.
(af_face_globals_compute_style_coverage)
[FT_CONFIG_OPTION_USE_HARFBUZZ]: Call `af_get_coverage'.
Update.

* src/autofit/afmodule.h (AF_ModuleRec):
s/fallback_script/fallback_style/.

* src/autofit/afmodule.c (af_property_set): Adapt handling of
`fallback-script' property to set a fallback style.
(af_property_get, af_autofitter_init): Updated.

* src/autofit/afpic.c: Update use of `SCRIPT' and `STYLE' macros.

* src/autofit/afranges.h: Update use of `SCRIPT' macro.

* src/autofit/autofit.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include
`hbshim.c'.

* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `hbshim.c'.
(AUTOF_DRV_H): Add `afcover.h'.

* builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Use pkg-config for
all libraries needed by FreeType.
2013-12-21 21:39:04 +01:00
Werner Lemberg 8a8f3758f1 [autofit] Fix PIC compilation.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths)
[FT_CONFIG_OPTION_PIC]: Declare `globals'.

* src/autofit/afglobal.c: Always call AF_DEFINE_SCRIPT_CLASS, and
AF_DEFINE_STYLE_CLASS.

* src/autofit/afpic.c: Include `afglobal.h'.
(autofit_module_class_pic_init): Typo.

* src/autofit/aftypes.h (AF_DEFINE_SCRIPT_CLASS,
AF_DEFINE_STYLE_CLASS): Don't use the same identifier for macro
parameter and structure member.
2013-12-20 18:35:35 +01:00
Werner Lemberg 974b193bcc [autofit] Introduce `styles'.
This is the new top-level structure for handling glyph input data;
scripts are now defined separately.

* src/autofit/aftypes.h (SCRIPT): Updated.
(AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
members to ...
(AF_Style_ClassRec): ... this new structure.
(AF_Style): New enumeration.
(AF_StyleMetricsRec): Replace `script' enumeration with
`style_class' pointer.
(AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
(AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.

* src/autofit/afstyles.h: New file, using data from `afscript.h'.
* src/autofit/afscript.h: Updated.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.

* src/autofit/afglobal.c (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
(af_style_names): ... this array.
(af_face_globals_compute_script_coverage): Renamed to...
(af_face_globals_compute_style_coverage): ... this.
Updated.
(af_face_globals_new, af_face_globals_free,
af_face_globals_get_metrics): Updated.

* src/autofit/afglobal.h (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(AF_SCRIPT_FALLBACK): Update definition.  This will get more
refinements with later on.
(AF_SCRIPT_UNASSIGNED): Replace with...
(AF_STYLE_UNASSIGNED): ... this macro.
(AF_FaceGlobalsRec): Updated.

* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
af_latin_hint_edges): Updated.

* src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
(af_ltn2_uniranges): Removed.

* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.

* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
* src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
(AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
members.

* src/autofit/afranges.h: Updated.

* src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
2013-12-20 17:26:26 +01:00
Werner Lemberg d8324571f1 [autofit] Factor scripts and uniranges out of writing system files.
* src/autofit/afranges.c, src/autofit/afranges.h: New files.

* src/autofit/afscript.h: Extend `SCRIPT' macro with more
parameters, taking data from the writing system files.

* src/autofit/aftypes.h: Updated.

* src/autofit/afglobal.c: Include `afranges.h'.
Load `afscript.h' to call AF_DEFINE_SCRIPT_CLASS.
* src/autofit/afglobal.c: Include `afranges.h'.
Load `afscript.h' to call AF_DECLARE_SCRIPT_CLASS.

* src/autofit/afcjk.c, src/autofit/afcjk.h: Updated.
* src/autofit/afdummy.c, src/autofit/afdummy.h: Updated.
* src/autofit/afindic.c, src/autofit/afindic.h: Updated.
* src/autofit/aflatin.c, src/autofit/aflatin.h: Updated.
* src/autofit/aflatn2.c, src/autofit/aflatn2.h: Updated.

* src/autofit/afpic.c: Updated.

* src/autofir/autofit.c: Include `afranges.c'.
* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afranges.c'.
2013-12-19 15:45:24 +01:00
Werner Lemberg 73f3198101 [autofit] More code orthogonality.
* src/autofit/aftypes.h (AF_StyleMetrics): Replace `script_class'
pointer to an `AF_ScriptClass' structure with `script' index of type
`AF_Script'.
Move some code around.

* src/autofit/afcjk.c: Include `afpic.h'.
(af_cjk_metrics_init_widths, af_cjk_metrics_init_blues,
af_cjk_hint_edges): Updated.

* src/autofit/aflatin.c: Include `afpic.h'.
(af_latin_metrics_init_widths, af_latin_metrics_init_blues,
af_latin_metrics_scale_dim, af_latin_hint_edges): Updated.

* src/autofit/afglobal.c (af_face_globals_get_metrics): Updated.

* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.
2013-12-19 15:24:17 +01:00
Werner Lemberg 115de7131d [autofit] Minor. 2013-12-18 16:06:09 +01:00
Werner Lemberg 3f91cb338b [autofit] s/ScriptMetrics/StyleMetrics/. 2013-12-18 12:59:35 +01:00
Werner Lemberg 4fccc214f9 [autofit] s/script_{metrics,hints}/style_{metrics,hints}/ 2013-12-18 12:53:01 +01:00
Werner Lemberg 7a5fc2f362 [autofit] s/AF_Script_/AF_WritingSystem_/ where appropriate. 2013-12-17 13:29:53 +01:00
Werner Lemberg a5f22a9ed2 [autofit] Add description strings to script entries.
Currently, this is unused.

* src/autofit/afscript.h: Do it.
* src/autofit/afglobal.c, src/autofit/afpic.c,
src/autofit/aftypes.h: Updated.
2013-10-17 11:08:25 +02:00
Werner Lemberg db3e5b9394 [autofit] Add blue stringsets.
* src/autofit/aftypes.h: Include `afblue.h'.
(AF_ScriptClassRec): Add `blue_stringset' field.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/autofit.c: Include `afblue.c'.

* src/autofit/afcjk.c (af_hani_script_class), src/autofit/afdummy.c
(af_dflt_script_class), src/autofit/afindic.c
(af_deva_script_class), src/autofit/aflatin.c
(af_latn_script_class), src/autofit/aflatin2.c
(af_ltn2_script_class): Updated.

* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afblue.c'.
2013-08-25 08:23:22 +02:00
Werner Lemberg 456cc440ca [autofit] Move declaration of scripts into separate file.
This has the benefit that we don't need to duplicate the data at
different places.

* src/autofit/afscript.h: New file.

* src/autofit/aftypes.h (AF_Script): Include `afscript.h' to define
the enumeration values.

* src/autofit/afglobal.c: Include `afscript.h' to get the script
specific header files.
(af_script_classes): Include `afscript.h' to fill this array.

* src/autofit/afpic.c: Include `afscript.h' to get the script
specific header files.
(autofit_module_class_pic_init): Include `afscript.h' for
initialization.
* src/autofit/afpic.h (AF_SCRIPT_CLASSES_COUNT,
AF_SCRIPT_CLASSES_REC_COUNT): Removed.  Use `AF_SCRIPT_MAX' instead.

* src/autofit/rules.mk (AUTOF_DRV_H): Updated.
2013-08-02 20:25:21 +02:00
Werner Lemberg 773601da12 [autofit] Move declaration of writing systems into separate file.
This has the benefit that we don't need to duplicate the data at
different places.

* src/autofit/afwrtsys.h: New file.

* src/autofit/aftypes.h (AF_WritingSystem): Include `afwrtsys.h' to
define the enumeration values.

* src/autofit/afglobal.c: Include `afwrtsys.h' to get the writing
system specific header files.
Include `afpic.h'.
(af_writing_system_classes): Include `afwrtsys.h' to fill this
array.

* src/autofit/afpic.c: Include `afwrtsys.h' to get the writing
system specific header files.
(autofit_module_class_pic_init): Include `afwrtsys.h' for
initialization.
* src/autofit/afpic.h (AF_WRITING_SYSTEM_CLASSES_COUNT,
AF_WRITING_SYSTEM_CLASSES_REC_COUNT): Removed.  Use
`AF_WRITING_SYSTEM_MAX' instead.
2013-08-02 19:51:17 +02:00
Werner Lemberg 72f5ff5bbb [autofit] Introduce `writing systems'.
This patch adds a new top level to the auto-hinter's script class
hierarchy.  It defines `writing systems' which can contain multiple
scripts.

For example, the `latin' writing system (in file `aflatin.c') is
able to support scripts like Latin, Cyrillic, Armenian, etc., which
can be handled similarly.

Scripts are now named using four-letter OpenType tags.

* src/autofit/aftypes.h (AF_ScriptClassRec): Move relevant members
to...
(AF_WritingSystemClassRec): This new structure.  It holds pointers
to functions which can be shared among related scripts.
(AF_WritingSystem): New enumeration.
(AF_Script): Revised values using four-letter tags.
(AF_DEFINE_WRITING_SYSTEM_CLASS): New macro.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/afglobal.c (af_writing_system_classes): New global,
constant array.
(af_script_classes): Updated.
(af_face_globals_free): Updated.
Remove assertion.
(af_face_globals_get_metrics): Updated.

* src/autofit/afglobal.h (AF_SCRIPT_FALLBACK)
[!AF_CONFIG_OPTION_CJK]: Handle this case.

* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.

* src/autofit/afpic.c (autofit_module_class_pic_init): Updated;
initialize structures for both writing systems and scripts.
* src/autofit/afpic.h: Updated.
(AF_WRITING_SYSTEM_CLASSES_GET): New macro.

* src/autofit/afcjk.c (af_cjk_writing_system_class): New writing
system.
(af_cjk_uniranges): Renamed to...
(af_hani_uniranges): This.
(af_cjk_script_class): Reduced and renamed to...
(af_hani_script_class): This.
* src/autofit/afcjk.h: Updated.

* src/autofit/afdummy.c (af_dummy_writing_system_class): New writing
system.
(af_dummy_script_class): Reduced and renamed to...
(af_dflt_script_class): This.
* src/autofit/afdummy.h: Updated.

* src/autofit/afindic.c (af_indic_writing_system_class): New writing
system.
(af_indic_uniranges): Renamed to...
(af_deva_uniranges): This.
(af_indic_script_class): Reduced and renamed to...
(af_deva_script_class): This.
* src/autofit/afcjk.h: Updated.

* src/autofit/aflatin.c (af_latin_writing_system_class): New writing
system.
(af_latin_uniranges): Renamed to...
(af_latn_uniranges): This.
(af_latin_script_class): Reduced and renamed to...
(af_latn_script_class): This.
* src/autofit/aflatin.h: Updated.

* src/autofit/aflatin2.c (af_latin2_writing_system_class): New
writing system.
(af_latin2_uniranges): Renamed to...
(af_ltn2_uniranges): This.
Synchronize ranges with `latin'.
(af_latin2_script_class): Reduced and renamed to...
(af_ltn2_script_class): This.
* src/autofit/aflatin2.h: Updated.
2013-07-31 22:57:01 +02:00
Werner Lemberg 5d6a360542 [autofit] Variable renaming.
* src/autofit/aftypes.h (AF_ScriptMetricsRec):
s/clazz/script_class/.
Update all users.
2013-07-31 22:57:01 +02:00
Werner Lemberg 553bb3c3ca [autofit] Add standard character to `AF_ScriptClassRec' structure.
* src/autofit/aftypes.h (AF_ScriptClassRec): Add `standard_char'
member.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/aflatin.c (af_latin_metrics_init_widths): Use it.
(af_latin_metrics_init, af_latin_script_class): Updated.

* src/autofit/aflatin.c (af_latin2_metrics_init_widths): Use it.
(af_latin2_metrics_init, af_latin2_script_class): Updated.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths): Use it.
(af_cjk_metrics_init, af_cjk_script_class): Updated.

* src/autofit/afindic.c(af_indic_metrics_init,
af_indic_script_class): Updated.

* src/autofit/afcjk.h, src/autofit/aflatin.h: Updated.

* src/autofit/afdummy.c: Updated.
2012-10-24 14:22:14 +02:00