Rand Stats

PDF::Font::Loader

zef:dwarring
0.8.11  2024-12-15T08:17:01+13:00
  - Fix handling of unmapped characters Identity-H encoding
  - Fix mis-classification of OpenType collections as non-CID fonts.

0.8.10  2024-12-07T08:25:26+13:00
  - Add file attribute to font objects.

0.8.9  2024-11-04T08:54:13+13:00
   - Add can-subset() method.

0.8.8  2024-10-16T07:26:50+13:00
   - Fix handling of CID-keyed CFF fonts

0.8.7  2024-08-09T05:32:42+12:00
   - Removed shaping support to PDF::Font::Loader::HarfBuzz. This module
     must be loaded to enable full shaping.

0.8.6  2024-08-03T09:13:48+12:00
   - Added more shaping tests.
   - Fixed output of zero width glyphs in CID fonts (for Arabic
     shaping test)

0.8.5  2024-07-29T07:21:53+12:00
   - Fix ToUnicode CMAP generation for ligature entries.

0.8.4  2024-07-28T10:30:37+12:00
   - Bug fixes to shaping. Make correct use of x/y advance and offset in
     shaping metrics.

0.8.3  2024-04-11T06:22:45+12:00
    - Fix potential embedding of *.ttc (True Type collection) fonts. They
      are not directly recognised as valid PDF font program and need to be
      processed by HarfBuzz::Subset.

0.8.2  2024-02-27T08:40:06+13:00
    - Add shape(:!kern) option. I.e shaping with horizontal kerning disabled.

0.8.1  2024-01-23T07:43:00+13:00
    - Set shaping direction from left-to-right

0.8.0  2024-01-22T06:22:19+13:00
   - Add auto-loading of type-1 AFM metrics. Look for a
     sibling *.afm file when loading type-1 *.pfa or *.pfb
     files and attach it.
   - Add shape() method:
     -- integrate HarfBuzz for TrueType and OpenType shaping
     -- fallback to kerning + typographic ligature substitution
        for other fonts
     -- Add allocate-cid() and encode-cids() method to encoders.
        To support HarfBuzz shaping, which may return non-unicode mapped
        glyphs.

0.7.8  2023-11-13T06:38:11+13:00
   - Further streamline CMAP encoding. Remove redundant code-point checks.
   - Minor ligature and glyph lookup fixes

0.7.7  2023-10-15T07:18:39+13:00
   - Fix CMap encoder to handle string decoding of non
     Unicode-standard ligatures #35
   - Improved compaction of ToUnicode CMaps 

0.7.6  2023-09-29T17:14:01+13:00
   - Fix a bug in parsing ToUnicode CMAPs #34

0.7.5  2023-09-01T08:55:54+12:00
   - Attempted zef upload

0.7.4  2023-08-26T07:30:02+12:00
   - Rename find-font :limit option to :best
   - make $cid-font.make-encoding-stream a private method

0.7.3  2023-08-22T15:14:44+12:00
   - Fix handling of OpenType/CFF embedded font files. Distinguish
     from simple CFF fonts.

0.7.2  2023-08-22T10:08:51+12:00
   - Fix attempted loading of *.ttc (true-type collection) fonts and
     mandatory subsetting via HarfBuzz::Subset

0.7.1  2023-08-03T09:18:47+12:00
   - Deprecate :seq in favour of :all and :limit options

0.7.0  2023-07-24T04:45:02+12:00
   - Prefer to use new FontConfig::Pattern class for font loading
   - Add :seq option to find-font(). Returns a sequence of font files,
     best match first.

0.6.14  2023-07-07T07:22:32+12:00
   - Use low level Font::FreeType .box() method for compatibility with v0.50+

0.6.13  2023-06-30T08:27:56+12:00
   - Check :$dict really is a core-font dictionary when used with :core-font

0.6.12  2023-06-30T07:47:19+12:00
   - Limit use of :core-font when combined with :dict. This only works with
     simple cases.

0.6.11  2023-06-29T09:16:58+12:00
    - Add :core-font option. This loads objects of type
      PDF::Content::Font::CoreFont rather than PDF::Font::Loader::FontObj

0.6.10  2023-04-15T09:36:17+12:00
    - Make FontConfig an optional dependency. Mostly to make this module
      installable under Windows.

0.6.9  2022-11-11T07:06:39+13:00
    - Further minor fixes to CID font handling

0.6.8  2022-10-31T13:54:05+13:00
    - Fixed detection and handling of CID indexed fonts. These are
      mapped to Fonts of Subtype Type0 with a descendant CIDFontType0
      or CIDFontType2 font.
    - Added script pdf-font-preview.raku

0.6.7  2022-07-27T07:09:34+12:00
    - Fix decoding of CMap ligatures #19

0.6.6  2022-07-06T08:26:48+12:00
    - Further fixes to CID allocation in CMap encoder

0.6.5  2022-07-06T07:28:35+12:00
    - Improved CID allocation in CMap encoder
    - Mostly replace embedded DejaVuSans with more compact Vera font
      in the test suite PDF files. Reduce distribution size #19
    - Allow for fractional values in font widths (/W) array
    - Fix font subsetting (HarfBuzz::Subset integration)
    - Protect setting encoder differences

0.6.4  2022-05-28T09:55:17+12:00
    - Fix font-descriptor() handling of fonts with a TT_PCLT table

0.6.3  2022-05-18T09:51:56+12:00
    - Use thread-safe version of Font::FreeType. Protect internal low-level
      glyph access.

0.6.2  2022-05-17T08:10:11+12:00
    - Improved handling of core fonts. Use standard core-font metrics over
      substituted font metrics.
    - Provide separate ax and sx attributes in glyphs. ax is the actual expected
      advance, taken from the /Widths or /W entry for the font, or in the case
      of core fonts, the standard width for the character. sx is the width of the
      substituted font. This helps with the scaling and placement of glyphs while
      rendering.

0.6.1  2022-05-12T08:23:14+12:00
    Initial page-level thread-safety
    - Bump PDF and PDF::Content to thread-safe versions
    - Lock dynamic module loading
    - Lock font encoding and dictionary creation
    - Add t/threads.t

0.6.0  2022-01-30T13:36:52+13:00
    - Fix dictionary construction of CFF fonts #13
    - Use FontConfig module for font resolution

0.5.16  2021-12-18T07:38:03+13:00
    - Add FontObj underline-position() and underline-thickness() methods
    - Fix load-font() handling of :$dict option

0.5.15  2021-10-15T07:45:19+13:00
    - Add load-font(:$prefix) option. To enable a pre-determined prefix (6
      uppercase letters) for subsetted fonts. Used in the test-suite to
      create stable PDF files, without any random characters.
    - Fix font encoding issue #12

0.5.14  2021-10-09T09:02:52+13:00
    - Detect WOFF fonts and disable embedding.
    - Performance improvement to CID fonts

0.5.13  2021-08-05T12:36:58+12:00
    - Fix PDF::Class compatibility by ensuring /Type0 (CID) font
      dictionaries are created with all mandatory fields in place.

0.5.12  2021-08-03T17:31:00+12:00
    - Change Glyph width and height attributes from dx(), dy() to ax() ay()
      for consistency with HarfBuzz module.
    - Initialize FontDescriptor with a /FontName entry (required field)

0.5.11  2021-08-03T12:24:32+12:00
    - Fix CMap code ranges to encode and decode as UTF16BE. See
      ISO-32000 9.10.3 ToUnicode CMaps
    - Disable writing of experimental utf8, utf16 and utf32 encodings
      for now. Sticking point is creating a ToUnicode CMap that works
      across all code ranges.

0.5.10  2021-07-31T10:50:31+12:00
    - Fix PDF::Font::Loader::Enc::Unicode decode() method
    - Fix CMap ligature handling
    - Fix inverted Identity-H %.charset attribute
    - Fix ToUnicode 'bfrange' construction

0.5.9 
    - Add PDF::Font::Loader::Enc::Unicode encoder (experimental) for reading and
      writing utf8, utf16 and utf32 encodings and CMaps
    - Handle input and output of Type0 fonts with potentially separate /ToUnicode
      and /Encoding CMaps. Also secondary CMaps referenced via /UseCMap from the
      main CMap.

0.5.8  2021-07-21T14:08:58+12:00
    - Fix reading and writing of CMap code space ranges for conformance with
      https://adobe-type-tools.github.io/font-tech-notes/pdfs/5014.CIDFont_Spec.pdf

0.5.7  2021-07-17T09:50:01+12:00
    - Fix glyph lookup for an embedded font without a char-map.

0.5.6  2021-07-13T13:40:44+12:00
   - Tweak loading of CID fonts from font dictionaries.
   - Documentation. README.md has been split into multiple *.md files and expanded
     in the docs/ directory.

0.5.5  2021-07-09T08:21:49+12:00
   - Implement reading of CMaps with variable encoding and
     CID mappings #9

0.5.4  2021-07-05T09:20:00+12:00
   - Add new sub-class PDF::Font::Loader::FontObj::CID
   - Fix ToUnicode CMaps for subsetted fonts
   - Allow subsetting of 'CFF' format OpenType fonts. HarfBuzz can
     handle these.

0.5.3  2021-06-30T11:20:17+12:00
   Glyph maps #8
   - Rename PDF::Font::Loader::Metrics -> PDF::Font::Loader::Glyph
     and shape() method to glyphs()
   - Handle unknown and un-mapped custom type-1 glyphs. Provide
     a glyphs(@cids) multi method to allow glyph extraction when
     there's no unicode mapping
   - Handle /CIDToGIDMap entries in font dictionaries

0.5.2  2021-06-26T09:58:42+12:00
   - Added PDF::Font::Loader::Metrics class and $font-obj.shape
     method.

0.5.1  2021-06-24T13:52:53+12:00
    Reusing a font within a PDF copies it #6
   - Accept :$dict option re-use it, updating as needed (char-maps,
     widths, encoding differences.
   - Renamed PDF::Font::Loader::FreeType -> PDF::Font::Loader::FontObj
   - Make font width tables authoritative; stringwidth() method now
     checks the font's width array (/W or /Widths entry) before
     consulting font metrics.
   - Add glyph-width() rw method
   - Fix font-name() and is-embedded() methods

0.5.0  2021-06-19T10:10:30+12:00
   More forgiving font handling #7
   - Added support for TrueType Collections, which must be embedded.
   - Change font validation to accept any FreeType font, but check
     basic characteristic are present, and only restrict embedding
     to permitted font formats.
   - Warn and disable embedding, rather that aborting, if the font
     doesn't meet embedding criteria.
   - Changed default option for loading from PDF dictionary :!embed
   - Defer some error checks until font object construction; to make
     reading of PDF files even more forgiving.

0.4.4  2021-03-26T08:13:56+13:00
   - Add PDF::Content::FontObj role to PDF::Font::Loader::FreeType

0.4.3  2021-01-21T14:09:43+13:00
   - put cmap handling back into main freetype class; fix identity
     fonts.

Release 0.4.2
   - Adjust to PDF 0.4.5+ (renamed PDF::Writer -> PDF::IO::Writer)
   - Make CMAP encoding adaptive. An unknown character is mapped to
     win encoding. If that fails, unallocated cids are allocated
     sequentially as unknown characters are encountered.

Release 0.4.1
   - Add find-font(:$lang) option
   - Improved font descriptor encoding detection
   - Add experimental font subsetting via new HarfBuzz::Subset module;
     disabled by default (may change in a later release).

Release 0.4.0
   - Fixed handling of CFF fonts
   - Work-in-progress on font subsetting

Release 0.3.1
   - Improved FontDescriptor properties using TT_Sfnt, introduced with
     Font::FreeType  v0.3.3.
     -- Improved: /ItalicAngle
     -- Added: /FontWeight /AvgWidth /Leading /MaxWidth /Style << /Panose ... >>

Release 0.3.0
   - Adjust to Font::FreeType 0.3.0

Release 0.2.9
   - Rename sources *.pm -> *.rakumod
   - [PDF::Font::Loader::Enc::CMap][cmap-decode.t]
     -- Make some use of code-ranges in the CMAP file; this seems to be
        the correct way of distinguishing 1 or 2 byte encodings.
     -- Added some support for older CMap ligature idioms

Release 0.2.8
   - Update to Font::FreeType 0.2.1

Release 0.2.7
   - [PDF::Font::Loader::Enc::CMap]
     -- Skip obviously invalid Unicode code-points.
     -- Added .encode() method. Initial support for /Identity-H
        and /Identity-V schemes
     -- Fixed identity-h encoding and decoding (16bit)

Release 0.2.6
   - [PDF::Font::Loader::FreeType]
     -- fix 'std' encoding
     -- handle float widths (convert to Int)

Release 0.2.5
   - Make compatible with Font::FreeType 0.2.2

Release 0.2.4
   - [PDF::Font::Loader::Dict] Prefer toUnicode map
     over encoding in font dictionaries
   - Adjustments for Font::FreeType 0.1.7.

Release 0.2.3
   - added experimental loading from a PDF Font dictionary.

     load-font: :$dict

     Back ported from [PDF::To::Cairo::]FontLoader.

Release 0.2.2
    - replace positional with :family parameter in find-font(),
      load-font(). For consistency with PDF::Content.load-font
      method.

Release 0.2.1
    - renamed classes PDF::DAO -> PDF::COS in PDF v0.2.8

Release 0.2.0
    - warn on Type1 Font being embedded, but not used

Release 0.1.9
    - fix scoping issues with Identity-H encoding
    - don't compress Type1 fonts. These are already encrypted.
    - simplify load-font multi-methods

Release 0.1.8
    support for PDF::To::Cairo font (WIP)

Release 0.1.7
    - fix kern method

Release 0.1.6
    - Add FontDescriptor dictionary required fields:
          ItalicAngle, StemV, CapHeight, XHeight

Release 0.1.5
    - Add :find-font, :load-font export subs
    - Add load-font :embed option

Release 0.1.4
    - Renamed dist PDF::Font -> PDF::Font::Loader

Release 0.1.2
    - Add .find-font, :weight, :width, :slant options

Release 0.1.1
    - Restrict type-1 font to Win encoding, freetype to Identity-H.
    - Added PDF::Font.find-font method

Release 0.1.0
    - Fixed font dictionary for type1 identity-h encoding
    - Changed method load-font:
      -- PDF::Font.load-font: :$file; # load from a font file
      -- PDF::Font.load-font: :$name; # load a font by name (experimental)

Release 0.0.3
    - Documentation changes

Release 0.0.2
    - Avoid loading TrueType Collections (type *.ttc). Not supported
      by Ghostscript 9.20 (and possibly other readers)

Release 0.0.1
    - Initial release