summaryrefslogtreecommitdiff
path: root/src/truetype
Commit message (Collapse)AuthorAgeFilesLines
* Fix Savannah bug #40975 (sort of).Werner Lemberg2013-12-211-5/+11
| | | | | * src/truetype/ttinterp.c (Ins_IP): Fix sign typo to make FreeType behave the same as the Windows TrueType engine for the invalid case.
* [truetype] Simplify logic of rendering modes.Infinality2013-12-113-36/+24
| | | | | | | | | | | | | | | This patch unifies the subpixel and non-subpixel cases. * src/truetype/ttinterp.h (TT_ExecContextRec): Remove `grayscale_hinting'; all code should refer to `grayscale' instead. Remove unused `native_hinting' member. Rename `subpixel_hinting' member to `subpixel. * src/truetype/ttgload.c (TT_LOADER_SET_PP): Updated. (tt_loader_init): Updated. * src/truetype/ttinterp.c (Ins_GETINFO): Simplify. Updated.
* [truetype] Fix scaling of vertical phantom points.Werner Lemberg2013-12-101-1/+13
| | | | | * src/truetype/ttgload.c (load_truetype_glyph): Scale pp3.x and pp4.x also.
* Formatting.Werner Lemberg2013-12-101-24/+37
|
* [truetype] Fix positioning of composite glyphs.Werner Lemberg2013-12-101-10/+2
| | | | | | | | | Problem reported by Nigel Tao <nigeltao@golang.org>. * src/truetype/ttgload.c (TT_Hint_Glyph): Remove code that shifts the glyph (component) by a fractional value computed from the LSB phantom point. This is wrong, since the horizontal phantom points get rounded horizontally later on.
* [truetype] Next round in phantom point handling.Werner Lemberg2013-12-071-11/+29
| | | | | | | | | | | Greg Hitchcock provided very interesting insights into the complicated history of the horizontal positions of the TSB and BSB phantom points. * src/truetype/ttgload.c (TT_LOADER_SET_PP) [TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Use `subpixel_hinting' and `grayscale_hinting' flags as conditionals for the x position of TSB and BSB.
* [truetype] Remove dead code.Werner Lemberg2013-12-031-7/+4
| | | | | | | | Reported by Nigel Tao <nigeltao@golang.org>. * include/internal/tttypes.h (TT_LoaderRec): Remove unused `preserve_pps' field. * src/truetype/ttgload.c (TT_Hint_Glyph): Updated.
* [truetype] Fix phantom point handling.Werner Lemberg2013-12-031-7/+42
| | | | | | | | | | This is a further improvement to the changes from 2013-11-06. * src/truetype/ttgload.c (TT_Hint_Glyph): Horizontal phantom points are rounded horizontally, vertical ones are rounded vertically. (TT_LOADER_SET_PP): The horizontal position of vertical phantom points in pre-ClearType mode is zero, as shown in the OpenType specification.
* Formatting.Werner Lemberg2013-12-021-1/+2
|
* [truetype] Fix change from 2013-11-20.Werner Lemberg2013-12-021-27/+17
| | | | | | | | | | | Problem reported by Akira Kakuto <kakuto@fuk.kindai.ac.jp>. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Protect call to `Update_Max' with both a TT_USE_BYTECODE_INTERPRETER guard and a `IS_HINTED' clause. Also remove redundant check using `maxSizeOfInstructions' – in simple glyphs, the bytecode data comes before the outline data, and a validity test for this is already present.
* [truetype]: Add tricky font names `hkscsiic.ttf' and `iicore.ttf'.Werner Lemberg2013-11-241-9/+10
| | | | | | * src/truetype/ttobjs.c (TRICK_NAMES_MAX_CHARACTERS, TRICK_NAMES_COUNT): Updated. (trick_names): Add family name for the two fonts.
* [truetype] Don't trust `maxp's `maxSizeOfInstructions'.Werner Lemberg2013-11-201-11/+30
| | | | | | | | | | | | | | | Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>; see http://lists.nongnu.org/archive/html/freetype-devel/2013-08/msg00005.html for details. * src/base/ftobjs.c (FT_Load_Glyph): Check size of `fpgm' and `prep' tables also for setting `autohint'. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use code from `TT_Process_Composite_Glyph' for handling unreliable values of `maxSizeOfInstructions'.
* [truetype] Fix last `truetype' commit.Werner Lemberg2013-11-121-3/+19
| | | | | | * src/truetype/ttgload.c (tt_get_metrics): Preserve stream position. Return error value. (load_truetype_glyph): Updated.
* [truetype] Fix handling of phantom points in composite glyphs.Werner Lemberg2013-11-061-3/+11
| | | | | | | | | Problem reported by Nigel Tao <nigeltao@golang.org>. This is a follow-up commit to the previous one. * src/truetype/ttgload.c (load_truetype_glyph): Call `tt_get_metrics' after loading the glyph header.
* [truetype] Improve emulation of vertical metrics.Werner Lemberg2013-11-063-27/+75
| | | | | | | | | | | | | | | | | | | | This commit also improves the start values of vertical phantom points. Kudos to Greg Hitchcock for help. * src/truetype/ttgload.c (TT_Get_VMetrics): Add parameter to pass `yMax' value. Replace code with fixed Microsoft definition. (tt_get_metrics): Updated. (TT_LOADER_SET_PP): Add explanation how to initialize phantom points, taken from both the OpenType specification and private communication with Greg (which will eventually be added to the standard). Fix horizontal position of `pp3' and `pp4'. * src/truetype/ttgload.h: Updated. * src/truetype/ttdriver.c (tt_get_advances): Updated. * docs/CHANGES: Updated.
* [truetype] Correctly reset point tags for glyph components.Werner Lemberg2013-11-051-1/+1
| | | | | | Problem reported by Nigel Tao <nigeltao@golang.org>. * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Fix loop.
* [truetype] Fix GETINFO opcode handling of subpixel hinting bits.Werner Lemberg2013-11-021-11/+8
| | | | | | | * src/truetype/ttinterp.c (Ins_GETINFO): Don't request bit 6 set to get info on subpixel hinting. * docs/CHANGES: Updated.
* [truetype] Minor code refactoring.Werner Lemberg2013-11-012-44/+40
| | | | | | | | | | | | | | | | | | Two benefits: The allocated FDEF (and IDEF) array gets slightly smaller, and the `ttdebug' demo program has access to function numbers without additional costs. Fortunately, no changes to FontForge are necessary – this is the only external TrueType debugger I know of, but others may exist and should check the code accordingly. * src/truetype/ttinterp.h (TT_CallRec): Replace `Cur_Restart' and `Cur_End' with a pointer to the corresponding `TT_DefRecord' structure. * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF, Ins_ENDF, Ins_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns <Invalid_Opcode>): Updated.
* Comment fix.Werner Lemberg2013-11-011-1/+1
|
* [arm] Fix thumb2 inline assembly under LLVM.Chongyu Zhu2013-10-151-0/+4
| | | | | | | | | | | | | | | | When using `ADD' with an immediate operand, the instruction is actually `ADD Rd, Rn, #<imm12>', that is, the maximum of the immediate operand cannot exceed 4095. It will fail to compile with LLVM. However, in GCC, due to some legacy compatibility considerations, `ADD.W' will be automatically emitted when the immediate operand is larger than 4095. * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h (FT_MulFix_arm) [__GNUC__]: Support clang compiler. * src/truetype/ttinterp.c (TT_MulFix14_arm) [__GNUC__]: Ditto.
* Implement support for WOFF containers.Werner Lemberg2013-08-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We simply synthesize a SFNT from the WOFF, create a memory stream for the new data, and load the SFNT as usual. Does NOT add any API to access WOFF metadata or private blocks. * include/freetype/internal/tttypes.h (WOFF_HeaderRec, WOFF_TableRec): New structures. * include/freetype/tttags.h (TTAG_wOFF): New macro. * src/base/ftobjs.c (FT_Open_Face): Set `stream' after calling `open_face'. * src/sfnt/sfobjs.c [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Include `FT_GZIP_H'. (WRITE_BYTE, WRITE_USHORT, WRITE_ULONG): New temporary macros for writing to a stream. (sfnt_stream_close, compare_offsets, woff_open_font): New functions. (sfnt_open_font): Handle `TTAG_wOFF'. (sfnt_init_face): Set `stream' after calling `sfnt_open_font'. * src/truetype/ttobjs.c (tt_face_init): Set `stream' after calling `sfnt->init_face'. * src/base/ftobjs.c (open_face): Use a pointer to FT_Stream as an argument so that a changed stream survives. Update callers.
* Better tracing of loaded glyphs.Werner Lemberg2013-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | Previously, the loading of a glyph was traced at level 4, if at all. With this change, all font loading routines emit a tracing message at level 1, making it easier to select tracing output (for example using F2_DEBUG="any:1 afhints:7 aflatin:7"). * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message. * src/cff/cffdrivr.c (cff_glyph_load): Ditto. * src/cff/cffgload.c (cff_decoder_prepare): Improve tracing messages. * src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing message. * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto. * src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message. * src/truetype/ttgload.c (TT_Load_Glyph): Ditto. * src/type1/t1gload.c (T1_Load_Glyph): Ditto. * src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto. * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.
* Fix gcc pragmas, part 2.Werner Lemberg2013-08-061-0/+8
| | | | | | * src/truetype/ttinterp.c (TT_MulFix14_long_long, TT_DotFix14_long_long): `#pragma gcc diagnostic {push,pop}' has been introduced with gcc version 4.6.
* Fix gcc pragmas.Werner Lemberg2013-08-051-8/+10
| | | | | | * src/truetype/ttinterp.c (TT_MulFix14_long_long, TT_DotFix14_long_long): Older gcc versions don't accept diagnostic pragmas within a function body.
* Add assembler code for TT_MulFix14 and TT_DotFix14.David Turner2013-07-161-23/+123
| | | | | | | | | | This patch provides slightly optimized versions for ARM, x86, and x86_64 CPUs if built with GCC. Also remove some dead code. * src/truetype/ttinterp.c (TT_MulFix14_arm, TT_MulFix14_long_long, TT_DotFix14_long_long): New functions.
* * Version 2.5.0 released.VER-2-5-0Werner Lemberg2013-06-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ========================= Tag sources with `VER-2-5-0'. * docs/VERSION.DLL: Update documentation and bump version number to 2.5.0. * README, Jamfile (RefDoc), builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html, builds/win32/visualc/freetype.dsp, builds/win32/visualc/freetype.vcproj, builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, builds/win32/visualce/freetype.vcproj, builds/win32/visualce/index.html, builds/wince/vc2005-ce/freetype.vcproj, builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/freetype.vcproj, builds/wince/vc2008-ce/index.html: s/2.4.12/2.5.0/, s/2412/250/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 5. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 16:2:10. * src/base/ftobjs.c (FT_Open_Face): Pacify compiler. * src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIRP): Ditto.
* [truetype] Improve handling of broken sbit advance widths.Werner Lemberg2013-06-101-0/+7
| | | | | | | * src/truetype/ttgload.c (TT_Load_Glyph): Use the glyph's (scaled) `linearHoriAdvance' if the sbit's `horiAdvance' value is zero. Cf. font `Fixedsys Excelsior' v3.01 (FSEX300.ttf), glyph A, 16ppem.
* Fix Savannah bug #39160.Werner Lemberg2013-06-101-0/+6
| | | | | * src/truetype/ttinterp.c (Ins_SDPVTL): Set projection vector too for the degenerate case.
* Next round of compiler fixes.Werner Lemberg2013-06-061-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * builds/win32/ftdebug.c, builds/wince/ftdebug.c (ft_debug_init): Add proper cast. * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Fix cast. * include/freetype/internal/ftstream.h: Decorate stream and frame macros with `FT_Long' and `FT_ULong' as appropriate. * src/base/ftrfork.c (raccess_guess_darwin_hfsplus, raccess_guess_darwin_newvfs): Use cast. * src/bdf/bdflib.c (_bdf_set_default_spacing): Use cast. * src/cache/ftcmanag.c (FTC_Manager_Check): Fix cast. * src/cache/ftcmanag.h (FTC_ManagerRec): Ditto. * src/cff/cf2arrst.c (cf2_arrstack_setNum_Elements): Use cast. * src/cff/cf2ft.c (cf2_freeSeacComponent): Ditto. * src/cff/cffobjs.c (remove_subset_prefix, remove_style): Ditto. * src/cid/cidparse.c (cid_parser_new): Use cast. * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Use cast. * src/psaux/psobjs.c (reallocate_t1_table): Fix argument type. * src/raster/ftraster.c (ft_black_reset): Use cast. * src/truetype/ttgxvar.c (FT_Stream_FTell): Use cast. (ALL_POINTS): Fix cast. * src/type1/t1driver.c (t1_ps_get_font_value): Add casts. * src/type1/t1parse.c (T1_Get_Private_Dict): Add cast.
* Fix compiler warnings.Werner Lemberg2013-06-052-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/freetype/internal/ftmemory.h: Decorate memory allocation macros with `FT_Long' where appropriate. Remove duplicate of FT_MEM_QRENEW_ARRAY definition. * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use cast. * src/base/ftobjs.c: Add warning disabling pragma for MSVC while including `md5.c'. * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdESC>: Add cast. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Fix casts. (tt_sbit_decoder_load_bitmap): Beautification. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Initialize variables (earlier). * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Pacify compiler. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use unsigned constants where appropriate. * src/type1/t1load.c (T1_Get_MM_Var): Ditto.
* Compilation fix.Behdad Esfahbod2013-05-231-2/+2
| | | | | * src/truetype/ttinterp.c (TT_RunIns) [!TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Make it work.
* [truetype] Formatting and an additional subpixel tweak.Infinality2013-05-212-4/+4
|
* [truetype] Adjust subpixel zp2 moves and tweak rules.Infinality2013-05-212-40/+50
|
* [truetype] Simplify and improve subpixel function detection.Infinality2013-05-203-227/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some small enhancements have allowed the removal of many macros and the simplification of existing rules in `ttsubpix.c'. * src/truetype/ttsubpix.h (SPH_TWEAK_ALLOW_X_DMOVEX, SPH_TWEAK_ALLOW_X_MOVE_ZP2, SPH_TWEAK_DELTAP_SKIP_EXAGGERATED_VALUES, SPH_TWEAK_SKIP_INLINE_DELTAS, SPH_TWEAK_MIRP_CVT_ZERO): Removed. (SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP): New rule macro. * src/truetype/ttsubpix.c: Updated affected rules. * src/truetype/ttinterp.c (Direct_Move_X): Updated. (INS_FDEF): Add additional function detection. (INS_ENDF): Set runtime flag. (Ins_CALL): Skip the call under certain conditions. Remove bad code. (Ins_LOOPCALL): Skip the call under certain conditions. Remove bad code. (Move_Zp2_Point): Updated. (Ins_SHPIX): Updated. Skip the move under some situations. (Ins_MIAP): Improve conditions. (Ins_MIRP): Updated. (Ins_DELTAP): Skip move under certain conditions. Simplify conditions. (TT_RunIns): Updated. Add code to handle new function detection. Trace messages.
* [truetype] Add `interpreter-version' property.Werner Lemberg2013-05-176-383/+553
| | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the option TT_CONFIG_OPTION_SUBPIXEL_HINTING controllable at runtime. * src/truetype/ttdriver.c: Include FT_TRUETYPE_DRIVER_H. (tt_property_set, tt_property_get): Fill templates. * src/truetype/ttobjs.h (TT_DriverRec): Add `interpreter_version' member. Remove unused `extension_component' member. * src/truetype/ttgload.c: Include FT_TRUETYPE_DRIVER_H. (tt_get_metrics, TT_Hint_Glyph, TT_Process_Simple_Glyph, compute_glyph_metrics, tt_loader_init): Use `interpreter_version'. * src/truetype/ttinterp.c: Include FT_TRUETYPE_DRIVER_H. (SUBPIXEL_HINTING): New macro to check `interpreter_version' flag. Update all affected functions to use it. Use TT_INTERPRETER_VERSION_XXX where appropriate. * src/truetype/ttobjs.c: Include FT_TRUETYPE_DRIVER_H. (tt_driver_init): Initialize `interpreter_version'. * src/truetype/ttsubpix.c: Include FT_TRUETYPE_DRIVER_H. Use TT_INTERPRETER_VERSION_XXX where appropriate.
* [truetype] Avoid empty source file.Werner Lemberg2013-05-131-1/+6
| | | | | * src/truetype/ttsubpix.c [!TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Provide dummy typedef.
* [truetype] Add framework for TrueType properties.Werner Lemberg2013-05-122-9/+55
| | | | | | | | | | | * src/truetype/ttdrivr.c: Include FT_SERVICE_PROPERTIES_H. (tt_property_set, tt_property_get): New functions, still empty. Define `tt_service_properties' service. Update `tt_services'. * src/truetype/ttpic.h: Include FT_SERVICE_PROPERTIES_H. (TT_SERVICE_PROPERTIES_GET): New macro. (TTModulePIC): Add `tt_service_properties'.
* */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.Werner Lemberg2013-05-101-3/+0
|
* More fixes for clang's `sanitize' feature.Werner Lemberg2013-05-041-5/+5
| | | | | | | | | | | | | | | | | | | | | * src/base/ftcalc.c (FT_DivFix): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate, FT_Vector_Length, FT_Vector_Polarize): Ditto. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Simplify. * src/cff/cffload.c (cff_subfont_load): Fix constant. * src/cff/cffparse.c (cff_parse_integer, cff_parse_real, do_fixed, cff_parse_fixed_dynamic): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/cid/cidload.c (cid_get_offset): Ditto. * src/psaux/psconv.c (PS_Conv_ToFixed): Ditto. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14): Ditto.
* Whitespace.Werner Lemberg2013-03-171-5/+3
|
* */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate.Werner Lemberg2013-03-143-4/+5
| | | | | FT_Err_XXX and friends are no longer directly used in the source code.
* */*: Use FT_Err_Ok only.Werner Lemberg2013-03-147-56/+56
| | | | This is a purely mechanical conversion.
* */*: Use `FT_THROW'.Werner Lemberg2013-03-146-144/+144
| | | | | | | | | | This is essentially a mechanical conversion, adding inclusion of `FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for stand-alone compiling modes of the rasterizer modules. To convert the remaining occurrences of FT_Err_XXX and friends it is necessary to rewrite the code. Note, however, that it doesn't harm if some cases are not handled since FT_THROW is a no-op.
* * src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables.Werner Lemberg2013-02-071-1/+16
| | | | | | BTW, Greg agrees that the OpenType specification is missing the list of GS variables which will always be reset to the default values after the `prep' table has been executed.
* * src/truetype/ttobjs.c (tt_size_run_prep): Reset reference points.Werner Lemberg2013-02-061-0/+5
| | | | | | | | | | | | Up to now, we simply took a snapshot of the Graphics State after the `prep' table has been executed, and right before a glyph's bytecode was run it got reloaded. However, as Greg Hitchcock has told us in private communication, reference points get reset to zero in the MS rasterizer and we follow in due course. While reasonable, this is undocumented behaviour. Most notably, this fixes the rendering of Arial's `x' glyph in subpixel hinting mode.
* [truetype] A better fix for Savannah bug #38211.Werner Lemberg2013-02-051-5/+11
| | | | | * src/truetype/ttinterp.c (Ins_IP): Implement identical behaviour to MS rasterizer if rp1 == rp2 (confirmed by Greg Hitchcock).
* [truetype] Fix Savannah bug #38211.Werner Lemberg2013-02-011-3/+12
| | | | | * src/truetype/ttinterp.c (Ins_IP): Make FreeType behave identical to other interpreters if rp1 == rp2 (which is invalid).
* Formatting, comment improvements.Werner Lemberg2013-01-286-68/+73
|
* [truetype] Minor formatting fix.Infinality2013-01-261-12/+12
|
* [truetype] Fix rasterizer_version logic in sph.Infinality2013-01-261-15/+19
|