Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of subset-fonts #426

Open
r-pf opened this issue Feb 27, 2020 · 2 comments · May be fixed by #704 or #648
Open

Support of subset-fonts #426

r-pf opened this issue Feb 27, 2020 · 2 comments · May be fixed by #704 or #648
Assignees

Comments

@r-pf
Copy link

r-pf commented Feb 27, 2020

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:
@ceztko
Copy link

ceztko commented Nov 9, 2021

+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

@Connum
Copy link
Contributor

Connum commented Nov 23, 2023

See #643

@Connum Connum self-assigned this Nov 23, 2023
@Connum Connum linked a pull request Nov 24, 2023 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment