summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* (test) mulfix perfewaldhew-wipEwald Hew2017-08-221-23/+23
|
* [psaux] Performance improvements (#43248).Ewald Hew2017-08-213-56/+91
| | | | | | | | | | | | | | | Implement proper disabling of hinting procedures when not hinting. This results in a ~30% speedup. * src/psaux/pshints.h (CF2_HintData): Gather hintmaps into hinting context. * src/psaux/pshints.c: Do not allocate structs unless needed. Skip hintmap funcs calls. Update references. * src/psaux/psintrp.c (cf2_interpT2CharString): Initialization for hinting context. <cntrmask, hintmask>: Ignore if not hinting. Update references.
* Documentation fixes.Ewald Hew2017-08-2129-42/+94
|
* Move `psdecode' into `psobjs'.Ewald Hew2017-08-2112-121/+92
| | | | | | | | | | | | | | As the former only contains a single procedure, move it into `psobjs' for simplicity. Also change the parameter order to the conventional one. * src/psaux/psdecode.c (ps_decoder_init): Moved to... * src/psaux/psobjs.c: ...Here. * src/psaux/psdecode.h, src/psaux/psobjs.h: Ditto. * include/freetype/internal/psaux.h: Update function signature. * src/cff/cffgload.c, src/cid/cidgload.c, src/type1/t1gload.c: Update calls. * src/psaux/psaux.c, src/psaux/psauxmod.c: Update includes. * src/psaux/Jamfile, src/psaux/rules.mk: Update file references.
* [psaux] Fix Type 1 hinting.Ewald Hew2017-08-211-10/+66
| | | | | | | | | | | Type 1 hinting breaks sometimes when mid-charstring hints should have been in the initial hintmap. This fix adds a preprocessing pass that reads all hints and builds the correct initial hintmap first, before proceeding to build the glyph outline. * src/psaux/psintrp.c (cf2_interpT2CharString): Add boolean flag. Ignore outline commands and hint changes on first pass. <endchar>: Add section to build hintmap and rewind.
* [psaux] Add tracing for hints.Ewald Hew2017-08-211-0/+49
| | | | | | | * src/psaux/pshints.c (cf2_hintmap_insertHint): Trace incoming and inserted hints. (cf2_hintmap_build): Dump hintmap before and after hint adjustment. (cf2_hintmap_dump): Using this new function.
* [psaux] Minor fixes.Ewald Hew2017-08-211-45/+23
| | | | | | | * src/psaux/psintrp.c (cf2_interpT2CharString): Fix check for pop results. s/font->decoder/decoder/. <hstem, vstem, hstem3, vstem3>: Use offset parameter in cf2_doStems instead of doing correction for left-sidebearing.
* [cid] Use the new engine.Ewald Hew2017-08-211-4/+53
| | | | | * src/cid/cidgload.c: Update includes. Implement changes to glyph loading code as with type1 module.
* [cid] Add Adobe engine config.Ewald Hew2017-08-212-3/+33
| | | | | | | This is similar to what was done in the type1 module. * src/cid/cidriver.c: Update declaration. * src/cid/cidobjs.c (cid_driver_init): Added.
* [psaux] Change subfont synthesis for CID fonts.Ewald Hew2017-08-214-14/+13
| | | | | | | | | | | | | | | Change t1_make_subfont to take in the Private dict record as an argument. This is because Type 1 and CID font records in FreeType have this in different places. * src/psaux/psobjs.c (t1_make_subfont): Change T1_Face to FT_Face so that CID is also accepted. Take PS_Private as an argument and let caller figure out where the Private dict actually is. Update references. * include/freetype/internal/psaux.h, src/psaux/psobjs.h: Update declaration. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Update call.
* [type1] Switch to Adobe engine.Ewald Hew2017-08-211-1/+1
| | | | * src/type1/t1objs.c (T1_Driver_Init): Set default to Adobe engine.
* [psaux] Extend Adobe interpreter. (seac)Ewald Hew2017-08-215-7/+303
| | | | | | | | | | | | This concludes the changes needed to add Type 1 support. * src/psaux/psintrp.c (cf2_interpT2CharString): Update includes. <seac>: Implement this similarly to implied seac for CFF. * src/psaux/t1decode.c: New function to lookup the glyph index. * src/psaux/psft.c: New procedures cf2_getT1SeacComponent and cf2_freeT1SeacComponent to get the charstrings for seac components. * src/psaux/t1decode.h, src/psaux/psft.h: Update declarations.
* [psaux] Extend Adobe interpreter. (callothersubr)Ewald Hew2017-08-211-7/+20
| | | | | | | * src/psaux/psintrp.c (cf2_interpT2CharString) <callothersubr>: Fix Flex feature handling. (OtherSubrs 0~2) <rmoveto>: Do not actually move the glyphPath while doing Flex. This is to avoid closing the current contour.
* [psaux] Extend Adobe interpreter. (callothersubr)Ewald Hew2017-08-211-1/+438
| | | | | | | | * src/psaux/psintrp.c (cf2_interpT2CharString) <callothersubr>: Copy code from t1decode.c (t1_decoder_parse_charstrings). OtherSubr 3 (change hints) should reset the hintmask, so that the new hints are applied. Fix function calls and stack access.
* [psaux] Extend Adobe interpreter. (pop)Ewald Hew2017-08-211-10/+14
| | | | | | | * src/psaux/psintrp.c (cf2_interpT2CharString): Change how unhandled OtherSubr results are stored. Implement the PostScript stack using an array. <pop>: Ensure that the stack is not cleared after getting OtherSubr results. Fix stack access.
* [psaux] Extend Adobe interpreter. (callsubr)Ewald Hew2017-08-212-7/+34
| | | | | | | * src/psaux/psintrp.c (cf2_interpT2CharString) <callsubr>: Type 1 mode. * src/psaux/psft.c (cf2_initLocalRegionBuffer): Add Type 1 mode.
* [psaux] Extend Adobe interpreter. (Numbers)Ewald Hew2017-08-211-7/+46
| | | | | | | | * src/psaux/psintrp.c (cf2_interpT2CharString) <div>: Add Type 1 mode. Type 1 requires large integers to be followed by div. cf. "Adobe Type 1 Font Format", section 6.2. <255>: Push Type 1 four-byte numbers as Int always. This is to ensure div and callsubr get values they can use.
* [psaux] Extend Adobe interpreter. (hints)Ewald Hew2017-08-211-20/+85
| | | | | | | | | * src/psaux/psintrp.c (cf2_interpT2CharString) <hstem, vstem>: Add correction for left sidebearing in Type 1 mode. Allow adding hints mid-charstring. <vstem3, hstem3>: Translate into equivalent commands for three normal stem hints. This requires some recalculation of stem positions. Correction for left sidebearing.
* [psaux] Extend Adobe interpreter. (hsbw, sbw)Ewald Hew2017-08-211-43/+57
| | | | | | | | * src/psaux/psintrp.c (cf2_doStems, cf2_interpT2CharString): Remove unused line. <hmoveto, vmoveto, rmoveto>: hsbw or sbw must be the first operation in a Type 1 charstring. Implement this check. <hsbw, sbw>: Fix data access and add correction for left sidebearing.
* [psaux] Extend Adobe interpreter. (setcurrentpoint)Ewald Hew2017-08-211-2/+3
| | | | | * src/psaux/psintrp.c (cf2_interpT2CharString) <setcurrentpoint>: Fix stack access.
* [psaux] Extend Adobe interpreter. (closepath)Ewald Hew2017-08-211-4/+2
| | | | | | | * src/psaux/psintrp.c (cf2_interpT2CharString) <closepath>: Use the right builder function. We can use the haveWidth boolean already present, instead of implementing parse_state.
* [psaux] Add Type 1 operations to Adobe CFF interpreter.Ewald Hew2017-08-211-22/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following Type 1 specific ops have been added (copied from t1decode): closepath vstem3 hstem3 seac sbw callothersubr pop setcurrentpoint hsbw The following require a Type 1 mode, because of differences in specification: hstem vstem vmoveto callsubr div rmoveto hmoveto Numbers The subsequent commits will implement these changes and adapt accesses of data and objects to the new interpreter. NOTE: Will not compile in the meantime! * src/psaux/psintrp.c: Add opcodes to enum. Copy relevant code over from t1decode.c (t1_decoder_parse_charstrings).
* [type1] Fixes for rendering.Ewald Hew2017-08-211-10/+19
| | | | | | | | | | | | | | The Type 1 advance width calculation passes null for glyph slot, etc, which can cause null pointer access in the new interpreter. Fall back to the old one for now. Fix the large glyph retry code and ensure hinting and scaling flags are set properly. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add a check for metrics_only. Set the force_scaling flag. (T1_Load_Glyph): Hinting and scaled flags.
* [psaux] Add missing objects. (2/2)Ewald Hew2017-08-215-0/+101
| | | | | | | | | | | | | | | Synthesize a SubFont object for Type 1 fonts. This is used in the interpreter to access Private dict data, which are stored in different places for Type 1 and CFF. This allows the same data to be used in either mode. * src/psaux/psobjs.c (t1_make_subfont): New procedure to copy required values to a dummy CFF_SubFont object. This is similar to cff_make_private_dict. * src/psaux/psobjs.h: Add the new declaration. * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Ditto. Add this to the PSAux Service for future use with CID fonts. * src/type1/t1gload.c: Add the call.
* [psaux] Add missing objects for Type 1. (1/2)Ewald Hew2017-08-214-8/+20
| | | | | | | | | | | | | | Move CF2_Font instance to PS_Decoder. This is the context for the interpreter and since it is currently stored in CFF_Font, is unavailable in Type 1 mode. * include/freetype/internal/psaux.h (T1_Decoder, PS_Decoder): Add the cf2_instance field. * src/psaux/psdecode.c (ps_decoder_init): Copy cf2_instance to PS_Decoder. Remove unused line. * src/psaux/t1decode.c (t1_decoder_done): Add finalization code. * src/psaux/psft.c: Update accesses.
* Allow type1 module to use the Adobe engine.Ewald Hew2017-08-215-14/+59
| | | | | | | | | | | | | | | | Add the callback and some conditionals to switch between the two engines. * include/freetype/internal/psaux.h (T1_Decoder_FuncsRec): Change function declarations. * src/psaux/psauxmod.c: Register the callbacks. * src/psaux/psobjs.c: Add conditionals for number conversion. * src/type1/t1gload.c: Add code to choose which renderer to use. * src/cid/cidgload.c: Update call. * src/base/ftobjs.c, src/psaux/psobjs.c, src/type1/t1gload.c: Update includes.
* [type1] Add Adobe engine config.Ewald Hew2017-08-214-3/+162
| | | | | | | | | | | | Use the previously changed PS_Driver in type1 module to store hinting engine configuration. * include/freetype/ftt1drv.h: New file. Duplicate and rename config options from CFF. * include/freetype/config/ftheader.h: Define the new file. * src/type1/t1driver.c: Update declaration. * src/type1/t1objs.c (T1_Driver_Init): Added.
* [cff] Move and rename CFF_DriverEwald Hew2017-08-219-37/+28
| | | | | | | | | | This is so that we can use the same hinting engine parameters for Type 1. * include/freetype/internal/cffotypes.h (CFF_Driver): Renamed to PS_Driver... * include/freetype/internal/psaux.h: ...and moved to here. * src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffload.c, src/cff/cffobjs.c, src/cff/cffobjs.h, src/psaux/psft.c, src/psaux/psobjs.c: Updated references.
* [psaux, type1] Reorganize object fields.Ewald Hew2017-08-214-25/+30
| | | | | | | | | | | | | | | | Make some fields more generic, so that we can access them the same way regardless of Type 1 or CFF. * include/freetype/internal/psaux.h (PS_Builder): Change TT_Face to FT_Face. Remove unused fields. * src/psaux/psft.c: Update all accesses of PS_Builder.face. Add some asserts to guard against casting T1_Face as TT_Face. * src/type1/t1objs.h (T1_GlyphSlot): Reorder fields to follow CFF_GlyphSlot, so that we can pretend they are the same in the interpreter. * src/psaux/psobjs.c: Updated with above changes.
* [psaux] Prepare for Type 1 modeEwald Hew2017-08-213-36/+45
| | | | | | | | | | | Add some checks for Type 1 data passing through. * src/psaux/psfont.h: Add isT1 flag to CF2_Font. * src/psaux/psfont.c: Skip the variations and blend code which is not applicable for Type 1. * src/psaux/psft.c: Avoid accessing decoder->cff in Type 1 mode. Copy is_t1 flag to CF2_Font.
* [psaux, cff] Use the new objects.Ewald Hew2017-08-2110-152/+163
| | | | | | | | | | | * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Fix switching between new and old engines. * src/cff/cffgload.c, src/cff/cffparse.c: Update calls. * src/psaux/psblues.c, src/psaux/psfont.c, src/psaux/psfont.h, src/psaux/psft.c, src/psaux/psft.h, src/psaux/psintrp.c: Update all to use new objects.
* [psaux] Objects for new interpreter (part 2)Ewald Hew2017-08-216-69/+164
| | | | | | | | | | | | | Make the new objects copy over values. They are essentially wrapper types for the different decoders/builders. * include/freetype/internal/psaux.h: Update declarations. Add is_t1 flag to PS_Builder. * src/psaux/psdecode.h, src/psaux/psobjs.h: Update declarations. * src/psaux/psdecode.c, src/psaux/psobjs.c: Implement copy with two modes. * src/psaux/psauxmod.c: Add builder and decoder functions to PSAux service.
* [psaux] Add objects for new interpreterEwald Hew2017-08-218-0/+561
| | | | | | | | | | | | | Introduce PS_Decoder and PS_Builder which include all fields from either Type 1 or CFF decoders/builders. * include/freetype/internal/psaux.h: Added new structs. * src/psaux/psobjs.c, src/psaux/psobjs.h: Added PS_Builder functions. * src/psaux/psdecode.c, src/psaux/psdecode.h: New file to hold decoder initialization functions. * src/psaux/psaux.c, src/psaux/Jamfile, src/psaux/rules.mk: Updated.
* [psaux] Rename filesEwald Hew2017-08-2125-83/+83
| | | | | | | | | | Replace the `cf2' file name prefix with `ps' as the Adobe engine will be used for both PostScript Types 1 and 2 (CFF) instead of just CFF. s/cf2/ps/ for all following. * src/psaux/cf2*: Renamed files. * src/psaux/*: Update includes. * src/psaux/Jamfile, src/psaux/rules.mk: Updated file references.
* [psaux] Minor fix.Ewald Hew2017-08-211-2/+13
| | | | | | | | Use MultiMasters service in psaux instead of a call to cff. The project builds if CFF_CONFIG_OPTION_OLD_ENGINE is not defined. * src/psaux/cf2ft.c: Update includes. (cf2_getNormalizedVector): Use mm->get_var_blend instead of cff_get_var_blend.
* [psaux, cff] Move cff_random into psaux service.Ewald Hew2017-08-217-17/+26
| | | | | | | | | | | | | | | NOTE: Does not compile! Minor fix to allow both `cff' and `psaux' to use cff_random. * src/cff/cffload.c (cff_random): Moved to... * src/psaux/psobjs.c: Here. * src/cff/cffload.h: Move corresponding declaration to src/psaux/psobjs.h. * include/freetype/internal/psaux.h (PSAux_ServiceRec): Register the function here... * src/psaux/psauxmod.c: And here. * src/cff/cffload.c, src/psaux/cf2intrp.c: Updated code.
* [cff] Move struct declarations to freetype/internalEwald Hew2017-08-2115-108/+129
| | | | | | | | | | | | | | | | | | | | | | | | NOTE: Does not compile! This is so that the CFF functions moved to `psaux' can access the same structs that they need. * src/cff/cfftypes.h: Moved to... * include/freetype/internal/cfftypes.h: Here. * src/cff/cffobjs.h: Moved the struct declarations to... * include/freetype/internal/cffotypes.h: Here. * include/freetype/internal/internal.h: Added defines for cfftypes.h and cffotypes.h * src/cff/cffcmap.h, src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffgload.h, src/cff/cffload.h, src/cff/cffobjs.c, src/cff/cffobjs.h, src/cff/cffparse.h, src/psaux/psobjs.h, include/freetype/internal/psaux.h, include/freetype/internal/services/svcfftl.h: Update includes. * src/cff/rules.mk: Updated.
* [psaux, cff] Add new service for inter-module calls.Ewald Hew2017-08-2111-32/+268
| | | | | | | | | | | | | | | | | NOTE: Does not compile! This is to allow CFF functions moved to `psaux' to call functions declared in src/cff/cffload.h. * include/freetype/internal/services/svcfftl.h: Create new FT_Service_CFFLoad service. * include/freetype/internal/ftserv.h: Added new macro FT_DEFINE_SERVICEDESCREC10. Added define for new service header. * src/cff/cffdrivr.c, src/cff/cffpic.h: Register the new service. * src/cff/cfftypes.h (CFF_FontRec), src/psaux/cf2font.h (CF2_FontRec): Add service interface. * src/cff/cffobjs.c, src/psaux/cf2font.c, src/psaux/cf2ft.c, src/psaux/cf2intrp.c, src/psaux/cffdecode.c: Use the new service.
* [psaux, cff] Add callbacks for inter-module calls.Ewald Hew2017-08-215-18/+44
| | | | | | | | | | | | NOTE: Does not compile! * include/freetype/internal/psaux.h: Add function pointer declarations. * src/psaux/cffdecode.c (cff_decoder_init): Updated to take in callbacks. * src/psaux/cffdecode.h: Ditto. * src/cff/cffgload.c (cff_compute_max_advance, cff_slot_load): Update calls to pass in callbacks. * src/psaux/cf2ft.c, src/psaux/cffdecode.c: Use them.
* [psaux, cff] Create new PSAux service interface entriesEwald Hew2017-08-216-29/+187
| | | | | | | | | | | | NOTE: Does not compile! * include/freetype/internal/psaux.h: Add declarations for new function tables. Minor fix for forward declaration of CFF_Builder. * src/psaux/psauxmod.c: Update the interface. * include/freetype/internal/tttypes.h (TT_FaceRec): Add service interface to CFF_Face(TT_Face). * src/cff/cffgload.c, src/cff/cffobjs.c, src/cff/cffparse.c: Update function calls to use psaux service.
* [psaux, cff] Move CFF builder components into `psaux' module.Ewald Hew2017-08-215-370/+381
| | | | | | | | | | | NOTE: Does not compile! * src/cff/cffgload.c (cff_builder_{init,done,add_point,add_point1,add_contour,start_point,close_contour}, cff_check_points): Moved to... * src/psaux/psobjs.c: Here. * src/cff/cffgload.h: Moved corresponding declarations to src/psaux/psobjs.h. * src/cff/cffgload.h (CFF_Builder): Moved struct declaration to... * include/freetype/internal/psaux.h: Here.
* [psaux, cff] Move CFF decoder components into `psaux' module.Ewald Hew2017-08-218-2374/+2429
| | | | | | | | | | | | | | | | | | | | NOTE: Does not compile! * src/cff/cffgload.c (CFF_Operator, CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts, cff_operator_seac, cff_compute_bias, cff_lookup_glyph_by_stdcharcode, cff_decoder_{parse_charstrings,init,prepare}): Moved to... * src/psaux/cffdecode.c: This new file. * src/cff/cffgload.h: Moved corresponding declarations to... * src/psaux/cffdecode.h: This new file. * src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS}, CFF_Decoder_Zone, CFF_Decoder): Moved declarations to... * include/freetype/internal/psaux.h: Here. * src/psaux/cf2ft.h: Updated include. * src/psaux/psaux.c, src/psaux/rules.mk: Updated with the new file.
* [psaux, cff] Move Adobe's engine components into `psaux' module.Ewald Hew2017-08-2128-37/+35
| | | | | | | | | | | | | This is the first patch of a sequence to move the Type 2 charstring processing capability from the `cff' module to the `psaux' module. NOTE: Does not compile! * src/cff/cf2*: Moved these files to... * src/psaux/cf2*: Here. * src/cff/Jamfile, src/cff/rules.mk, src/cff/cff.c, src/cff/cffgload.c: Removed file references. * src/psaux/Jamfile, src/psaux/rules.mk, src/psaux/psaux.c, : Added file references.
* [sfnt] Avoid synthetic unicode for symbol fonts with PUA.Alexei Podtelezhnikov2017-08-172-1/+12
| | | | | | | | Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=754574 * src/sfnt/sfobjs.c (sfnt_load_face): Check for FT_ENCODING_MS_SYMBOL.
* * src/sfnt/pngshim.c (premultiply_data): Fix compiler warnings.Werner Lemberg2017-08-162-3/+7
|
* [sfnt] Speed up PNG image loading.Behdad Esfahbod2017-08-162-3/+60
| | | | | | | | This reduces the overhead of `premultiply_data' by 60%. * src/sfnt/pngshim.c (premultiply_data): Provide code which uses gcc's (and clang's) `vector_byte' attribute to process 4 pixels at a time.
* Minor comment fix.Werner Lemberg2017-08-161-4/+5
|
* Harmony CHANGES.Alexei Podtelezhnikov2017-08-131-1/+12
|
* Minor.Werner Lemberg2017-08-131-1/+1
|
* [sfnt, truetype] Improve handling of missing sbits.Werner Lemberg2017-08-114-4/+86
| | | | | | | | | | | | | | | | | | | | Requested by Behdad. Modern bitmap-only SFNTs like `NotoColorEmoji.ttf' don't contain entries in the bitmap strike(s) for empty glyphs. Instead, they rely that a space glyph gets created from the font's metrics data. This commit makes FreeType behave accordingly. * include/freetype/fterrdef.h (FT_Err_Missing_Bitmap): New error code. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_image): Change error codes to make a distinction between a missing bitmap in a composite and a simple missing bitmap. * src/truetype/ttgload.c (TT_Load_Glyph): For a missing bitmap (in a bitmap-only font), synthesize an empty bitmap glyph if metrics are available.