Fonts prohibiting installable embedding
Norbert Preining
norbert at preining.info
Sat Oct 2 02:20:09 CEST 2021
Hi Karl,
> Presumably the flag is the default in some tool. Clearly those font
> (designer)s do not intend to restrict embedding.
That was my idea, too!
> The string "texlive" does not appear on either page? (I guess I'm going
You are right, this is strange (and one of the reasons I recently
despise lintian). They were there when I sent the email, but in the
meantime it seems the list was regenerated, and whatever change did
trigger a different list. One never knows...
> If original fonts distributed in TL have the flag set, we should discuss
> with authors. Is there a simple cmdline tool that can check a file?
Agreed. Concerning cmdline, I fear no .. lintian does something as
follows in perl for opentype, see
https://salsa.debian.org/lintian/lintian/-/blob/master/lib/Lintian/Check/Fonts/Opentype.pm
(and Truetype.pm for a similar code)
const my $PERMISSIONS_MASK => 0x0f;
const my $NEVER_EMBED_FLAG => 0x02;
const my $PRINT_PREVIEW_ONLY_FLAG => 0x04;
const my $EDIT_ONLY_FLAG => 0x08;
sub visit_installed_files {
my ($self, $file) = @_;
return
unless $file->is_file;
return
unless $file->file_info =~ /^OpenType font data/;
$self->hint('opentype-font-wrong-filename', $file->name)
unless $file->name =~ /\.otf$/i;
my $font = Font::TTF::Font->open($file->unpacked_path);
my $os2 = defined $font ? $font->{'OS/2'} : undef;
my $table = defined $os2 ? $os2->read : undef;
my $fs_type = defined $table ? $table->{fsType} : undef;
$font->release
if defined $font;
return
unless defined $fs_type;
my @clauses;
my $permissions = $fs_type & $PERMISSIONS_MASK;
push(@clauses, 'never embed')
if $permissions & $NEVER_EMBED_FLAG;
push(@clauses, 'preview/print only')
if $permissions & $PRINT_PREVIEW_ONLY_FLAG;
push(@clauses, 'edit only')
if $permissions & $EDIT_ONLY_FLAG;
my $terms;
$terms = join($COMMA . $SPACE, @clauses)
if @clauses;
$self->hint('opentype-font-prohibits-installable-embedding',
"[$terms] " . $file->name)
if length $terms;
return;
}
> In any case, I would not consider this a reason to start removing fonts
> willy-nilly. I'd like to see some kind of confirmation or evidence that
100% agreed, nothing should be removed for now.
> the font designers actually intended to restrict embedding, not just an
> obscure flag that was probably not set intentionally 99% of the time. -k
That was also my reasoning.
Best
Norbert
--
PREINING Norbert https://www.preining.info
Fujitsu Research + IFMGA Guide + TU Wien + TeX Live + Debian Dev
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
More information about the tex-live
mailing list.