opentype.js icon indicating copy to clipboard operation
opentype.js copied to clipboard

Support of subset-fonts

Open r-pf opened this issue 5 years ago • 2 comments
trafficstars

Fonts.zip

The attached file BAAAAA+Bauhaus93.ttf was extracted from a PDF. It was build as subset of BAUHS93.TTF and contains only the glyphs used by "Hello World" (=> 'H', 'e', 'l', 'o', ' ', 'W', 'r', 'd').

Expected Behavior

Is it possible to extend opentype.js to support such subset-fonts also.

Current Behavior

Currently an error-messae occured: Error: No valid cmap sub-tables found.

Possible Solution

fontforge can open BAAAAA+Bauhaus93.ttf and view the glyphs of it.

Steps to Reproduce (for bugs)

  1. Open https://opentype.js.org/index.html
  2. Open BAAAAA+Bauhaus93.ttf
  3. The error-message occured

Context

Your Environment

  • Version used:
  • Font used: BAAAAA+Bauhaus93.ttf
  • Browser Name and version: FireFox 72.0.1 (64bit)
  • Operating System and version (desktop or mobile): Linux
  • Link to your project:

r-pf avatar Feb 27 '20 00:02 r-pf

+1 . According to ISO 32000:2008 (PDF 1.7):

A TrueType font program may be used as part of either a font or a CIDFont. Although the basic font file format is the same in both cases, there are different requirements for what information shall be present in the font program. These TrueType tables shall always be present if present in the original TrueType font program: “head”, “hhea”, “loca”, “maxp”, “cvt”, “prep”, “glyf”, “hmtx”, and “fpgm”. If used with a simple font dictionary, the font program shall additionally contain a cmap table defining one or more encodings, as discussed in 9.6.6.4, "Encodings for TrueType Fonts". If used with a CIDFont dictionary, the cmap table is not needed and shall not be present, since the mapping from character codes to glyph descriptions is provided separately.

The following font is a valid subset used in a pdf (both attached).

FontSubset.zip TestSubset.pdf

ceztko avatar Nov 09 '21 12:11 ceztko

See #643

Connum avatar Nov 23 '23 16:11 Connum