<commit_before>#!/usr/bin/perl

# Written by Dr. <NAME> (<EMAIL>)
# Senior Computer Scientist 2, Adobe Inc.
# Version 2019-03-27
#
# This tool takes a hinting parameter file of a particular format as
# input (an example from Source Han Sans ExtraLight is provided at the
# end of this script), and uses it to apply hinting parameters, such
# as alignment zones and stem values, to the header of a CIDFont
# resource that is provided as STDIN. A new CIDFont resource is
# written to STDOUT, which then needs to be processed by the AFDKO
# autohint tool.
#
# Note that the FontName of each FDArray element must be in a form
# that includes the CIDFontName plus a unique identifier, such as
# Dingbats. For Source Han Sans ExtraLight, the FontName would be
# SourceHanSans-ExtraLight-Dingbats. The hinting parameter file
# specifies only the unique identifier, such as Dingbats.
#
# Tool Dependencies: None

$hintparam = $ARGV[0];

open(FILE,"<$hintparam") or die "Cannot open $hintparam input file!\n";

while(defined($line = <FILE>)) {
    chomp $line;
    if ($line =~ /^([A-Z][A-Za-z0-9]?.+)$/) {
        $hintdictname1 = $1;
    } elsif ($line =~ /(\/(?:BlueValues|OtherBlues|Std(?:H|V)W|StemSnap(?:H|V))\s+\[\s*.+\s*\]\s+def)/) {
        $hintdata{$hintdictname1} .= $1 . "\n";
    }
}

while(defined($line = <STDIN>)) {
    if ($line =~ /\/CIDFontName\s+\/(.+)\s+def/) {
        $cidfontname = $1;
        print STDERR "Detected CIDFontName: $cidfontname\n";
    } elsif ($line =~ /\/FontName \/${cidfontname}-(.+)\s+def/) {
        $hintdictname2 = $1;<commit_msg>Update hintcidfont.pl to read BlueScale values<commit_after>#!/usr/bin/perl

# Written by Dr. <NAME> (<EMAIL>)
# Senior Computer Scientist 2, Adobe Inc.
# Version 2019-03-27
#
# This tool takes a hinting parameter file of a particular format as
# input (an example from Source Han Sans ExtraLight is provided at the
# end of this script), and uses it to apply hinting parameters, such
# as alignment zones and stem values, to the header of a CIDFont
# resource that is provided as STDIN. A new CIDFont resource is
# written to STDOUT, which then needs to be processed by the AFDKO
# autohint tool.
#
# Note that the FontName of each FDArray element must be in a form
# that includes the CIDFontName plus a unique identifier, such as
# Dingbats. For Source Han Sans ExtraLight, the FontName would be
# SourceHanSans-ExtraLight-Dingbats. The hinting parameter file
# specifies only the unique identifier, such as Dingbats.
#
# Tool Dependencies: None

$hintparam = $ARGV[0];

open(FILE,"<$hintparam") or die "Cannot open $hintparam input file!\n";

while(defined($line = <FILE>)) {
    chomp $line;
    if ($line =~ /^([A-Z][A-Za-z0-9]?.+)$/) {
        $hintdictname1 = $1;
    } elsif ($line =~ /(\/(?:BlueValues|BlueScale|OtherBlues|Std(?:H|V)W|StemSnap(?:H|V))\s+\[?\s*.+\s*\]?\s+def)/) {
        $hintdata{$hintdictname1} .= $1 . "\n";
    }
}

while(defined($line = <STDIN>)) {
    if ($line =~ /\/CIDFontName\s+\/(.+)\s+def/) {
        $cidfontname = $1;
        print STDERR "Detected CIDFontName: $cidfontname\n";
    } elsif ($line =~ /\/FontName \/${cidfontname}-(.+)\s+def/) {
        $hintdictname2 = $1;
{'fraction_non_alphanumeric': 0.1495444549167452, 'fraction_numerical': 0.011938422871504869, 'mean_word_length': 3.5945165945165947, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3340267', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1099, 'n_words': 364}