src/reportlab/pdfbase/_cidfontdata.py
author robin
Thu, 24 Oct 2019 16:07:15 +0100
changeset 4551 d357e2acc856
parent 4528 e09377955af8
permissions -rw-r--r--
improve usage of eval/exec; version --> 3.5.32
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4330
617ffa6bbdc8 changes for release 3.4.0
robin <robin@reportlab.com>
parents: 4252
diff changeset
     1
#Copyright ReportLab Europe Ltd. 2000-2017
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
     2
#see license.txt for license details
4528
e09377955af8 try to eliminate changed bitbucket.org references
robin
parents: 4370
diff changeset
     3
#history https://hg.reportlab.com/hg-public/reportlab/log/tip/src/reportlab/pdfbase/_cidfontdata.py
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
     4
#$Header $
4252
fe660f227cac changes for release 3.3.0
robin
parents: 4024
diff changeset
     5
__version__='3.3.0'
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
     6
__doc__="""
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
     7
This defines additional static data to support CID fonts.
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
     8
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
     9
Canned data is provided for the Japanese fonts supported by Adobe. We
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    10
can add Chinese, Korean and Vietnamese in due course. The data was
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    11
extracted by creating very simple postscript documents and running
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    12
through Distiller, then examining the resulting PDFs.
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    13
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    14
Each font is described as a big nested dictionary.  This lets us keep
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    15
code out of the module altogether and avoid circular dependencies.
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    16
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    17
The encoding and font data are grouped by some standard 'language
3031
6f90e7668adb docstrings cleaned up for epydoc
tim
parents: 2964
diff changeset
    18
prefixes'::
6f90e7668adb docstrings cleaned up for epydoc
tim
parents: 2964
diff changeset
    19
6f90e7668adb docstrings cleaned up for epydoc
tim
parents: 2964
diff changeset
    20
    chs = Chinese Simplified (mainland)
6f90e7668adb docstrings cleaned up for epydoc
tim
parents: 2964
diff changeset
    21
    cht = Chinese Traditional (Taiwan)
6f90e7668adb docstrings cleaned up for epydoc
tim
parents: 2964
diff changeset
    22
    kor = Korean
6f90e7668adb docstrings cleaned up for epydoc
tim
parents: 2964
diff changeset
    23
    jpn = Japanese
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    24
"""
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
    25
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
    26
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
    27
languages = ['jpn', 'kor', 'cht', 'chs']
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    28
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    29
#breaking down the lists let us check if something is present
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    30
#for a specific language
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
    31
typeFaces_chs = ['STSong-Light'] # to do
2629
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
    32
typeFaces_cht = ['MSung-Light']  #, 'MHei-Medium'] # to do
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    33
typeFaces_jpn = ['HeiseiMin-W3', 'HeiseiKakuGo-W5']
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
    34
typeFaces_kor = ['HYSMyeongJo-Medium','HYGothic-Medium']
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    35
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    36
allowedTypeFaces = typeFaces_chs + typeFaces_cht + typeFaces_jpn + typeFaces_kor
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    37
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    38
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    39
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
    40
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    41
encodings_jpn = [
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    42
    # official encoding names, comments taken verbatim from PDF Spec
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    43
    '83pv-RKSJ-H',      #Macintosh, JIS X 0208 character set with KanjiTalk6
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    44
                        #extensions, Shift-JIS encoding, Script Manager code 1
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    45
    '90ms-RKSJ-H',      #Microsoft Code Page 932 (lfCharSet 0x80), JIS X 0208
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    46
                        #character set with NEC and IBM extensions
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    47
    '90ms-RKSJ-V',      #Vertical version of 90ms-RKSJ-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    48
    '90msp-RKSJ-H',     #Same as 90ms-RKSJ-H, but replaces half-width Latin
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    49
                        #characters with proportional forms
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    50
    '90msp-RKSJ-V',     #Vertical version of 90msp-RKSJ-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    51
    '90pv-RKSJ-H',      #Macintosh, JIS X 0208 character set with KanjiTalk7
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    52
                        #extensions, Shift-JIS encoding, Script Manager code 1
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    53
    'Add-RKSJ-H',       #JIS X 0208 character set with Fujitsu FMR extensions,
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    54
                        #Shift-JIS encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    55
    'Add-RKSJ-V',       #Vertical version of Add-RKSJ-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    56
    'EUC-H',            #JIS X 0208 character set, EUC-JP encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    57
    'EUC-V',            #Vertical version of EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    58
    'Ext-RKSJ-H',       #JIS C 6226 (JIS78) character set with NEC extensions,
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    59
                        #Shift-JIS encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    60
    'Ext-RKSJ-V',       #Vertical version of Ext-RKSJ-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    61
    'H',                #JIS X 0208 character set, ISO-2022-JP encoding,
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    62
    'V',                #Vertical version of H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    63
    'UniJIS-UCS2-H',    #Unicode (UCS-2) encoding for the Adobe-Japan1 character
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    64
                        #collection
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    65
    'UniJIS-UCS2-V',    #Vertical version of UniJIS-UCS2-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    66
    'UniJIS-UCS2-HW-H', #Same as UniJIS-UCS2-H, but replaces proportional Latin
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    67
                        #characters with half-width forms
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    68
    'UniJIS-UCS2-HW-V'  #Vertical version of UniJIS-UCS2-HW-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    69
    ]
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    70
encodings_kor = [
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    71
    'KSC-EUC-H',        # KS X 1001:1992 character set, EUC-KR encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    72
    'KSC-EUC-V',        # Vertical version of KSC-EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    73
    'KSCms-UHC-H',      # Microsoft Code Page 949 (lfCharSet 0x81), KS X 1001:1992
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    74
                        #character set plus 8,822 additional hangul, Unified Hangul
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    75
                        #Code (UHC) encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    76
    'KSCms-UHC-V',      #Vertical version of KSCms-UHC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    77
    'KSCms-UHC-HW-H',   #Same as KSCms-UHC-H, but replaces proportional Latin
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    78
                        # characters with halfwidth forms
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    79
    'KSCms-UHC-HW-V',   #Vertical version of KSCms-UHC-HW-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    80
    'KSCpc-EUC-H',      #Macintosh, KS X 1001:1992 character set with MacOS-KH
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    81
                        #extensions, Script Manager Code 3
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    82
    'UniKS-UCS2-H',     #Unicode (UCS-2) encoding for the Adobe-Korea1 character collection
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    83
    'UniKS-UCS2-V'      #Vertical version of UniKS-UCS2-H
1683
7fa753e4420a Removed all trailing whitespace
andy_robinson
parents: 1401
diff changeset
    84
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    85
    ]
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    86
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    87
encodings_chs = [
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    88
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    89
    'GB-EUC-H',         # Microsoft Code Page 936 (lfCharSet 0x86), GB 2312-80
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    90
                        # character set, EUC-CN encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    91
    'GB-EUC-V',         # Vertical version of GB-EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    92
    'GBpc-EUC-H',       # Macintosh, GB 2312-80 character set, EUC-CN encoding,
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    93
                        # Script Manager code 2
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    94
    'GBpc-EUC-V',       # Vertical version of GBpc-EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    95
    'GBK-EUC-H',        # Microsoft Code Page 936 (lfCharSet 0x86), GBK character
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    96
                        # set, GBK encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    97
    'GBK-EUC-V',        # Vertical version of GBK-EUC-V
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    98
    'UniGB-UCS2-H',     # Unicode (UCS-2) encoding for the Adobe-GB1
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    99
                        # character collection
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   100
    'UniGB-UCS2-V'     # Vertical version of UniGB-UCS2-H.
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   101
    ]
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   102
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   103
encodings_cht = [
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   104
    'B5pc-H',           # Macintosh, Big Five character set, Big Five encoding,
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   105
                        # Script Manager code 2
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   106
    'B5pc-V',           # Vertical version of B5pc-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   107
    'ETen-B5-H',        # Microsoft Code Page 950 (lfCharSet 0x88), Big Five
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   108
                        # character set with ETen extensions
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   109
    'ETen-B5-V',        # Vertical version of ETen-B5-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   110
    'ETenms-B5-H',      # Microsoft Code Page 950 (lfCharSet 0x88), Big Five
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   111
                        # character set with ETen extensions; this uses proportional
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   112
                        # forms for half-width Latin characters.
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   113
    'ETenms-B5-V',      # Vertical version of ETenms-B5-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   114
    'CNS-EUC-H',        # CNS 11643-1992 character set, EUC-TW encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   115
    'CNS-EUC-V',        # Vertical version of CNS-EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   116
    'UniCNS-UCS2-H',    # Unicode (UCS-2) encoding for the Adobe-CNS1
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   117
                        # character collection
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   118
    'UniCNS-UCS2-V'    # Vertical version of UniCNS-UCS2-H.
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   119
    ]
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   120
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   121
# the Identity encodings simply dump out all character
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   122
# in the font in the order they were defined.
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   123
allowedEncodings = (['Identity-H', 'Identity-V'] +
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   124
                    encodings_chs +
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   125
                    encodings_cht +
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   126
                    encodings_jpn +
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   127
                    encodings_kor
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   128
                    )
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   129
2575
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   130
defaultUnicodeEncodings = {
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   131
    #we ddefine a default Unicode encoding for each face name;
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   132
    #this should be the most commonly used horizontal unicode encoding;
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   133
    #also define a 3-letter language code.
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   134
    'HeiseiMin-W3': ('jpn','UniJIS-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   135
    'HeiseiKakuGo-W5': ('jpn','UniJIS-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   136
    'STSong-Light': ('chs', 'UniGB-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   137
    'MSung-Light': ('cht', 'UniGB-UCS2-H'),
2629
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   138
    #'MHei-Medium': ('cht', 'UniGB-UCS2-H'),
2575
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   139
    'HYSMyeongJo-Medium': ('kor', 'UniKS-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   140
    'HYGothic-Medium': ('kor','UniKS-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   141
    }
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   142
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   143
typeFaces_chs = ['STSong-Light'] # to do
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   144
typeFaces_cht = ['MSung-Light', 'MHei-Medium'] # to do
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   145
typeFaces_jpn = ['HeiseiMin-W3', 'HeiseiKakuGo-W5']
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   146
typeFaces_kor = ['HYSMyeongJo-Medium','HYGothic-Medium']
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   147
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   148
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   149
#declare separately those used for unicode
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   150
unicode_encodings = [enc for enc in allowedEncodings if 'UCS2' in enc]
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   151
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   152
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   153
CIDFontInfo = {}
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   154
#statically describe the fonts in Adobe's Japanese Language Packs
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   155
CIDFontInfo['HeiseiMin-W3'] = {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   156
            'Type':'/Font',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   157
            'Subtype':'/Type0',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   158
            'Name': '/%(internalName)s' , #<-- the internal name
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   159
            'BaseFont': '/HeiseiMin-W3',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   160
            'Encoding': '/%(encodings)s',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   161
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   162
            #there could be several descendant fonts if it is an old-style
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   163
            #type 0 compound font.  For CID fonts there is just one.
1683
7fa753e4420a Removed all trailing whitespace
andy_robinson
parents: 1401
diff changeset
   164
            'DescendantFonts': [{
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   165
                'Type':'/Font',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   166
                'Subtype':'/CIDFontType0',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   167
                'BaseFont':'/HeiseiMin-W3',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   168
                'FontDescriptor': {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   169
                    'Type': '/FontDescriptor',
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   170
                    'Ascent': 723,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   171
                    'CapHeight': 709,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   172
                    'Descent': -241,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   173
                    'Flags': 6,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   174
                    'FontBBox': (-123, -257, 1001, 910),
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   175
                    'FontName': '/HeiseiMin-W3',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   176
                    'ItalicAngle': 0,
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   177
                    'StemV': 69,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   178
                    'XHeight': 450#,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   179
#                    'Style': {'Panose': '<010502020400000000000000>'}
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   180
                    },
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   181
                'CIDSystemInfo': {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   182
                    'Registry': '(Adobe)',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   183
                    'Ordering': '(Japan1)',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   184
                    'Supplement': 2
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   185
                    },
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   186
                #default width is 1000 em units
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   187
                'DW': 1000,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   188
                #widths of any which are not the default.
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   189
                'W': [1, [250, 333, 408, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   190
                      5, [500, 833, 778, 180, 333],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   191
                      10, [333, 500, 564, 250, 333, 250, 278, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   192
                      18, 26, 500, 27, 28, 278, 29, 31, 564,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   193
                      32, [444, 921, 722, 667],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   194
                      36, [667, 722, 611, 556, 722],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   195
                      41, [722, 333, 389, 722, 611, 889, 722],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   196
                      48, [722, 556, 722, 667, 556, 611, 722],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   197
                      55, [722, 944, 722],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   198
                      58, [722, 611, 333, 500, 333, 469, 500, 333,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   199
                           444, 500, 444, 500, 444, 333, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   200
                      73, [500, 278],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   201
                      75, [278, 500, 278, 778, 500], 80, 82, 500,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   202
                      83, [333, 389, 278, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   203
                      87, [500, 722, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   204
                      90, [500, 444, 480, 200, 480, 333],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   205
                      97, [278], 99, [200], 101, [333, 500], 103, [500, 167],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   206
                      107, [500], 109, [500, 333], 111, [333, 556],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   207
                      113, [556, 500], 117, [250], 119, [350, 333, 444],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   208
                      123, [500], 126, [444, 333], 128, 137, 333,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   209
                      138, [1000, 889, 276, 611, 722, 889, 310, 667, 278],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   210
                      147, [278, 500, 722, 500, 564, 760, 564, 760],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   211
                      157, 158, 300, 159, [500, 300, 750], 162, 163, 750,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   212
                      164, 169, 722, 170, [667, 611], 172, 174, 611, 175,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   213
                      178, 333, 179, 185, 722, 187, 191, 722, 192,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   214
                      [556, 444], 194, 203, 444, 204, 207, 278, 208,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   215
                      214, 500, 216, 222, 500,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   216
                      223, [556, 722, 611, 500, 389, 980, 444],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   217
                      231, [500], 323, [500], 325, [500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   218
                      327, 389, 500]
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   219
##                'W': (
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   220
##                    # starting at character ID 1, next n  characters have the widths given.
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   221
##                    1,  (277,305,500,668,668,906,727,305,445,445,508,668,305,379,305,539),
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   222
##                    # all Characters from ID 17 to 26 are 668 em units wide
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   223
##                    17, 26, 668,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   224
##                    27, (305, 305, 668, 668, 668, 566, 871, 727, 637, 652, 699, 574, 555,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   225
##                         676, 687, 242, 492, 664, 582, 789, 707, 734, 582, 734, 605, 605,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   226
##                         641, 668, 727, 945, 609, 609, 574, 445, 668, 445, 668, 668, 590,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   227
##                         555, 609, 547, 602, 574, 391, 609, 582, 234, 277, 539, 234, 895,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   228
##                         582, 605, 602, 602, 387, 508, 441, 582, 562, 781, 531, 570, 555,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   229
##                         449, 246, 449, 668),
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   230
##                    # these must be half width katakana and the like.
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   231
##                    231, 632, 500
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   232
##                    )
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   233
                }]# end list of descendant fonts
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   234
            } #end HeiseiMin-W3
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   235
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   236
CIDFontInfo['HeiseiKakuGo-W5'] =  {'Type':'/Font',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   237
            'Subtype':'/Type0',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   238
            'Name': '/%(internalName)s', #<-- the internal name
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   239
            'BaseFont': '/HeiseiKakuGo-W5',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   240
            'Encoding': '/%(encodings)s',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   241
            'DescendantFonts': [{'Type':'/Font',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   242
                'Subtype':'/CIDFontType0',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   243
                'BaseFont':'/HeiseiKakuGo-W5',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   244
                'FontDescriptor': {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   245
                    'Type': '/FontDescriptor',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   246
                    'Ascent': 752,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   247
                    'CapHeight': 737,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   248
                    'Descent': -221,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   249
                    'Flags': 4,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   250
                    'FontBBox': [-92, -250, 1010, 922],
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   251
                    'FontName': '/HeiseKakuGo-W5',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   252
                    'ItalicAngle': 0,
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   253
                    'StemH': 0,
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   254
                    'StemV': 114,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   255
                    'XHeight': 553,
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   256
##                    'Style': {'Panose': '<0801020b0600000000000000>'}
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   257
                    },
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   258
                'CIDSystemInfo': {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   259
                    'Registry': '(Adobe)',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   260
                    'Ordering': '(Japan1)',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   261
                    'Supplement': 2
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   262
                    },
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   263
                'DW': 1000,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   264
                'W': (
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   265
                    1, (277,305,500,668,668,906,727,305,445,445,508,668,305,379,305,539),
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   266
                    17, 26, 668,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   267
                    27, (305, 305, 668, 668, 668, 566, 871, 727, 637, 652, 699, 574, 555,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   268
                                         676, 687, 242, 492, 664, 582, 789, 707, 734, 582, 734, 605, 605,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   269
                                         641, 668, 727, 945, 609, 609, 574, 445, 668, 445, 668, 668, 590,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   270
                                         555, 609, 547, 602, 574, 391, 609, 582, 234, 277, 539, 234, 895,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   271
                                         582, 605, 602, 602, 387, 508, 441, 582, 562, 781, 531, 570, 555,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   272
                                         449, 246, 449, 668),
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   273
                    231, 632, 500
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   274
                    )
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   275
                }] # end descendant fonts
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   276
            }
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   277
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   278
CIDFontInfo['HYGothic-Medium'] =  {'Type':'/Font',
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   279
            'Subtype':'/Type0',
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   280
            'Name': '/%(internalName)s', #<-- the internal name
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   281
            'BaseFont': '/' + 'HYGothic-Medium',
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   282
            'Encoding': '/%(encodings)s',
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   283
            'DescendantFonts': [{'Type':'/Font',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   284
                'Subtype':'/CIDFontType0',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   285
                'BaseFont':'/'+'HYGothic-Medium',
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   286
                'FontDescriptor': {
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   287
                    'Type': '/FontDescriptor',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   288
                    'Ascent': 752,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   289
                    'AvgWidth': -271,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   290
                    'CapHeight': 737,
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   291
                    'Descent': -142,
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   292
                    'Flags': 6,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   293
                    'FontBBox': [-6, -145, 1003, 880],
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   294
                    'FontName': '/'+'HYSMyeongJo-Medium',
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   295
                    'ItalicAngle': 0,
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   296
                    'Leading': 148,
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   297
                    'MaxWidth': 1000,
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   298
                    'MissingWidth': 500,
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   299
                    'StemH': 0,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   300
                    'StemV': 58,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   301
                    'XHeight': 553
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   302
                    },
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   303
                'CIDSystemInfo': {
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   304
                    'Registry': '(Adobe)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   305
                    'Ordering': '(Korea1)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   306
                    'Supplement': 1
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   307
                    },
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   308
                'DW': 1000,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   309
                'W': (1, 94, 500)
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   310
                }] # end descendant fonts
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   311
            }
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   312
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   313
CIDFontInfo['HYSMyeongJo-Medium'] =  {'Type':'/Font',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   314
            'Subtype':'/Type0',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   315
            'Name': '/%(internalName)s', #<-- the internal name
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   316
            'BaseFont': '/' + 'HYSMyeongJo-Medium',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   317
            'Encoding': '/%(encodings)s',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   318
            'DescendantFonts': [{'Type':'/Font',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   319
                'Subtype':'/CIDFontType2',
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   320
                'BaseFont':'/'+'HYSMyeongJo-Medium',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   321
                'FontDescriptor': {
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   322
                    'Type': '/FontDescriptor',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   323
                    'Ascent': 752,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   324
                    'AvgWidth': 500,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   325
                    'CapHeight': 737,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   326
                    'Descent': -271,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   327
                    'Flags': 6,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   328
                    'FontBBox': [0, -148, 1001, 880],
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   329
                    'FontName': '/'+'HYSMyeongJo-Medium',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   330
                    'ItalicAngle': 0,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   331
                    'Leading': 148,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   332
                    'MaxWidth': 1000,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   333
                    'MissingWidth': 500,
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   334
                    'StemH': 91,
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   335
                    'StemV': 58,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   336
                    'XHeight': 553
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   337
                    },
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   338
                'CIDSystemInfo': {
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   339
                    'Registry': '(Adobe)',
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   340
                    'Ordering': '(Korea1)',
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   341
                    'Supplement': 1
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   342
                    },
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   343
                'DW': 1000,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   344
                'W': [1, [333, 416],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   345
                      3, [416, 833, 625, 916, 833, 250, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   346
                      10, 11, 500,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   347
                      12, [833, 291, 833, 291, 375, 625],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   348
                      18, 26, 625, 27, 28, 333, 29, 30, 833,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   349
                      31, [916, 500, 1000, 791, 708],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   350
                      36, [708, 750, 708, 666, 750, 791, 375,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   351
                           500, 791, 666, 916, 791, 750, 666,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   352
                           750, 708, 666, 791],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   353
                      54, [791, 750, 1000, 708],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   354
                      58, [708, 666, 500, 375, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   355
                      63, 64, 500,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   356
                      65, [333, 541, 583, 541, 583],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   357
                      70, [583, 375, 583],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   358
                      73, [583, 291, 333, 583, 291, 875, 583],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   359
                      80, 82, 583,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   360
                      83, [458, 541, 375, 583],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   361
                      87, [583, 833, 625],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   362
                      90, [625, 500, 583], 93, 94, 583,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   363
                      95, [750]
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   364
                      ]
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   365
                }] # end descendant fonts
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   366
            }
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   367
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   368
#WARNING - not checked, just copied Korean to get some output
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   369
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   370
CIDFontInfo['STSong-Light'] =  {'Type':'/Font',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   371
            'Subtype':'/Type0',
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   372
            'Name': '/%(internalName)s', #<-- the internal name
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   373
            'BaseFont': '/' + 'STSong-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   374
            'Encoding': '/%(encodings)s',
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   375
            'DescendantFonts': [{'Type':'/Font',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   376
                'Subtype':'/CIDFontType0',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   377
                'BaseFont':'/'+'STSong-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   378
                'FontDescriptor': {
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   379
                    'Type': '/FontDescriptor',
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   380
                    'Ascent': 752,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   381
                    'CapHeight': 737,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   382
                    'Descent': -271,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   383
                    'Flags': 6,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   384
                    'FontBBox': [-25, -254, 1000, 880],
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   385
                    'FontName': '/'+'STSongStd-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   386
                    'ItalicAngle': 0,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   387
                    'Leading': 148,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   388
                    'MaxWidth': 1000,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   389
                    'MissingWidth': 500,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   390
                    'StemH': 91,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   391
                    'StemV': 58,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   392
                    'XHeight': 553
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   393
                    },
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   394
                'CIDSystemInfo': {
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   395
                    'Registry': '(Adobe)',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   396
                    'Ordering': '(GB1)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   397
                    'Supplement': 0
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   398
                    },
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   399
                'DW': 1000,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   400
                'W': [1, [207, 270, 342, 467, 462, 797, 710, 239, 374],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   401
                      10, [374, 423, 605, 238, 375, 238, 334, 462],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   402
                      18, 26, 462, 27, 28, 238, 29, 31, 605,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   403
                      32, [344, 748, 684, 560, 695, 739, 563, 511, 729,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   404
                           793, 318, 312, 666, 526, 896, 758, 772, 544,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   405
                           772, 628, 465, 607, 753, 711, 972, 647, 620,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   406
                           607, 374, 333, 374, 606, 500, 239, 417, 503,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   407
                           427, 529, 415, 264, 444, 518, 241, 230, 495,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   408
                           228, 793, 527, 524],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   409
                      81, [524, 504, 338, 336, 277, 517, 450, 652, 466,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   410
                           452, 407, 370, 258, 370, 605]
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   411
                      ]
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   412
                }] # end descendant fonts
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   413
            }
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   414
CIDFontInfo['MSung-Light'] =  {'Type':'/Font',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   415
            'Subtype':'/Type0',
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   416
            'Name': '/%(internalName)s', #<-- the internal name
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   417
            'BaseFont': '/' + 'MSung-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   418
            'Encoding': '/%(encodings)s',
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   419
            'DescendantFonts': [{'Type':'/Font',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   420
                'Subtype':'/CIDFontType0',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   421
                'BaseFont':'/'+'MSung-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   422
                'FontDescriptor': {
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   423
                    'Type': '/FontDescriptor',
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   424
                    'Ascent': 752,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   425
                    'CapHeight': 737,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   426
                    'Descent': -271,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   427
                    'Flags': 6,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   428
                    'FontBBox': [-160, -249, 1015, 888],
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   429
                    'FontName': '/'+'MSung-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   430
                    'ItalicAngle': 0,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   431
                    'Leading': 148,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   432
                    'MaxWidth': 1000,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   433
                    'MissingWidth': 500,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   434
                    'StemH': 45,
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   435
                    'StemV': 58,
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   436
                    'XHeight': 553
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   437
                    },
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   438
                'CIDSystemInfo': {
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   439
                    'Registry': '(Adobe)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   440
                    'Ordering': '(CNS1)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   441
                    'Supplement': 1
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   442
                    },
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   443
                'DW': 1000,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   444
                'W': [1, 2, 250, 3, [408, 668, 490, 875, 698, 250, 240],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   445
                      10, [240, 417, 667, 250, 313, 250, 520, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   446
                      18, 26, 500, 27, 28, 250, 29, 31, 667,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   447
                      32, [396, 921, 677, 615, 719, 760, 625, 552, 771,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   448
                           802, 354],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   449
                      43, [354, 781, 604, 927, 750, 823, 563, 823, 729,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   450
                           542, 698, 771, 729, 948, 771, 677, 635, 344,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   451
                           520, 344, 469, 500, 250, 469, 521, 427, 521,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   452
                           438, 271, 469, 531, 250],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   453
                      75, [250, 458, 240, 802, 531, 500, 521],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   454
                      82, [521, 365, 333, 292, 521, 458, 677, 479, 458,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   455
                           427, 480, 496, 480, 667]]
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   456
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   457
                }] # end descendant fonts
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   458
            }
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   459
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   460
2629
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   461
#this data was derived from the above width information and removes all dependency on CMAP files as long as we only use the unicode fonts.
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   462
widthsByUnichar = {}
4024
744e4dafbf6e _cidfontdata.py: keep u'' strings
robin
parents: 3794
diff changeset
   463
widthsByUnichar["MSung-Light"] = {u' ': 250, u'$': 490, u'(': 240, u',': 250, u'0': 500, u'4': 500, u'8': 500, u'<': 667, u'@': 921, u'D': 760, u'H': 802, u'L': 604, u'P': 563, u'T': 698, u'X': 771, u'\\': 520, u'`': 250, u'd': 521, u'h': 531, u'l': 240, u'p': 521, u't': 292, u'x': 479, u'|': 496, u'#': 668, u"'": 250, u'+': 667, u'/': 520, u'3': 500, u'7': 500, u';': 250, u'?': 396, u'C': 719, u'G': 771, u'K': 781, u'O': 823, u'S': 542, u'W': 948, u'[': 344, u'_': 500, u'c': 427, u'g': 469, u'k': 458, u'o': 500, u's': 333, u'w': 677, u'{': 480, u'"': 408, u'&': 698, u'*': 417, u'.': 250, u'2': 500, u'6': 500, u':': 250, u'>': 667, u'B': 615, u'F': 552, u'J': 354, u'N': 750, u'R': 729, u'V': 729, u'Z': 635, u'^': 469, u'b': 521, u'f': 271, u'j': 250, u'n': 531, u'r': 365, u'v': 458, u'z': 427, u'~': 667, u'!': 250, u'%': 875, u')': 240, u'-': 313, u'1': 500, u'5': 500, u'9': 500, u'=': 667, u'A': 677, u'E': 625, u'I': 354, u'M': 927, u'Q': 823, u'U': 771, u'Y': 677, u']': 344, u'a': 469, u'e': 438, u'i': 250, u'm': 802, u'q': 521, u'u': 521, u'y': 458, u'}': 480}
744e4dafbf6e _cidfontdata.py: keep u'' strings
robin
parents: 3794
diff changeset
   464
widthsByUnichar["HeiseiKakuGo-W5"] = {u'\uff81': 500, u'\uff85': 500, u'\uff89': 500, u'\uff8d': 500, u'\uff91': 500, u'\uff95': 500, u'\uff99': 500, u'\uff9d': 500, u' ': 277, u'$': 668, u'(': 445, u',': 305, u'0': 668, u'\u0332': 668, u'4': 668, u'8': 668, u'<': 668, u'@': 871, u'D': 699, u'H': 687, u'L': 582, u'P': 582, u'T': 641, u'X': 609, u'`': 590, u'\uff62': 500, u'd': 602, u'\uff66': 500, u'h': 582, u'\uff6a': 500, u'l': 234, u'\uff6e': 500, u'p': 602, u'\uff72': 500, u't': 441, u'\uff76': 500, u'x': 531, u'\uff7a': 500, u'|': 246, u'\uff7e': 500, u'\uff82': 500, u'\uff86': 500, u'\uff8a': 500, u'\uff8e': 500, u'\uff92': 500, u'\uff96': 500, u'\uff9a': 500, u'\uff9e': 500, u'#': 668, u"'": 305, u'+': 668, u'/': 539, u'3': 668, u'7': 668, u';': 305, u'?': 566, u'C': 652, u'G': 676, u'K': 664, u'O': 734, u'S': 605, u'W': 945, u'[': 445, u'_': 668, u'\uff61': 500, u'c': 547, u'\uff65': 500, u'g': 609, u'\uff69': 500, u'k': 539, u'\uff6d': 500, u'o': 605, u'\uff71': 500, u's': 508, u'\uff75': 500, u'w': 781, u'\uff79': 500, u'{': 449, u'\uff7d': 500, u'\u0300': 590, u'\uff83': 500, u'\u2002': 500, u'\uff87': 500, u'\uff8b': 500, u'\uff8f': 500, u'\uff93': 500, u'\uff97': 500, u'\uff9b': 500, u'\uff9f': 500, u'"': 500, u'\xa5': 668, u'&': 727, u'*': 508, u'.': 305, u'2': 668, u'6': 668, u':': 305, u'>': 668, u'B': 637, u'F': 555, u'J': 492, u'N': 707, u'\u203e': 500, u'R': 605, u'V': 727, u'Z': 574, u'^': 668, u'b': 609, u'\uff64': 500, u'f': 391, u'\uff68': 500, u'j': 277, u'\uff6c': 500, u'n': 582, u'\uff70': 500, u'r': 387, u'\uff74': 500, u'v': 562, u'\uff78': 500, u'z': 555, u'\uff7c': 500, u'~': 668, u'\uff80': 500, u'\u0303': 668, u'\uff84': 500, u'\uff88': 500, u'\uff8c': 500, u'\u2011': 379, u'\uff90': 500, u'\uff94': 500, u'\uff98': 500, u'\uff9c': 500, u'!': 305, u'%': 906, u')': 445, u'-': 379, u'1': 668, u'5': 668, u'9': 668, u'=': 668, u'A': 727, u'E': 574, u'I': 242, u'M': 789, u'Q': 734, u'U': 668, u'Y': 609, u']': 445, u'a': 555, u'\uff63': 500, u'e': 574, u'\uff67': 500, u'i': 234, u'\uffe8': 500, u'\uff6b': 500, u'm': 895, u'\uff6f': 500, u'q': 602, u'\uff73': 500, u'u': 582, u'\uff77': 500, u'y': 570, u'\uff7b': 500, u'}': 449, u'\uff7f': 500}
744e4dafbf6e _cidfontdata.py: keep u'' strings
robin
parents: 3794
diff changeset
   465
widthsByUnichar["HYSMyeongJo-Medium"] = {u' ': 333, u'$': 625, u'(': 500, u',': 291, u'0': 625, u'4': 625, u'8': 625, u'<': 833, u'D': 750, u'H': 791, u'L': 666, u'P': 666, u'T': 791, u'X': 708, u'\\': 375, u'`': 333, u'd': 583, u'h': 583, u'l': 291, u'p': 583, u't': 375, u'x': 625, u'|': 583, u'#': 833, u"'": 250, u'+': 833, u'/': 375, u'3': 625, u'7': 625, u';': 333, u'?': 500, u'C': 708, u'G': 750, u'K': 791, u'O': 750, u'S': 666, u'[': 500, u'_': 500, u'c': 541, u'g': 583, u'k': 583, u'o': 583, u's': 541, u'w': 833, u'{': 583, u'"': 416, u'&': 833, u'*': 500, u'.': 291, u'2': 625, u'6': 625, u':': 333, u'>': 916, u'B': 708, u'F': 666, u'J': 500, u'N': 791, u'R': 708, u'V': 750, u'Z': 666, u'^': 500, u'b': 583, u'f': 375, u'j': 333, u'n': 583, u'r': 458, u'v': 583, u'z': 500, u'~': 750, u'!': 416, u'%': 916, u')': 500, u'-': 833, u'1': 625, u'5': 625, u'9': 625, u'=': 833, u'A': 791, u'E': 708, u'I': 375, u'M': 916, u'Q': 750, u'U': 791, u'Y': 708, u']': 500, u'a': 541, u'e': 583, u'i': 291, u'm': 875, u'q': 583, u'u': 583, u'y': 625, u'}': 583}
744e4dafbf6e _cidfontdata.py: keep u'' strings
robin
parents: 3794
diff changeset
   466
widthsByUnichar["STSong-Light"] = {u' ': 207, u'$': 462, u'(': 374, u',': 238, u'0': 462, u'4': 462, u'8': 462, u'<': 605, u'@': 748, u'D': 739, u'H': 793, u'L': 526, u'P': 544, u'T': 607, u'X': 647, u'\\': 333, u'`': 239, u'd': 529, u'h': 518, u'l': 228, u'p': 524, u't': 277, u'x': 466, u'|': 258, u'#': 467, u"'": 239, u'+': 605, u'/': 334, u'3': 462, u'7': 462, u';': 238, u'?': 344, u'C': 695, u'G': 729, u'K': 666, u'O': 772, u'S': 465, u'W': 972, u'[': 374, u'_': 500, u'c': 427, u'g': 444, u'k': 495, u'o': 524, u's': 336, u'w': 652, u'{': 370, u'"': 342, u'&': 710, u'*': 423, u'.': 238, u'2': 462, u'6': 462, u':': 238, u'>': 605, u'B': 560, u'F': 511, u'J': 312, u'N': 758, u'R': 628, u'V': 711, u'Z': 607, u'^': 606, u'b': 503, u'f': 264, u'j': 230, u'n': 527, u'r': 338, u'v': 450, u'z': 407, u'~': 605, u'!': 270, u'%': 797, u')': 374, u'-': 375, u'1': 462, u'5': 462, u'9': 462, u'=': 605, u'A': 684, u'E': 563, u'I': 318, u'M': 896, u'Q': 772, u'U': 753, u'Y': 620, u']': 374, u'a': 417, u'e': 415, u'i': 241, u'm': 793, u'q': 504, u'u': 517, u'y': 452, u'}': 370}
744e4dafbf6e _cidfontdata.py: keep u'' strings
robin
parents: 3794
diff changeset
   467
widthsByUnichar["HeiseiMin-W3"] = {u'\uff81': 500, u'\u0302': 333, u'\uff85': 500, u'\u0306': 333, u'\uff89': 500, u'\u030a': 333, u'\uff8d': 500, u'\uff91': 500, u'\ufb02': 556, u'\uff95': 500, u'\uff99': 500, u'\uff9d': 500, u' ': 250, u'\xa3': 500, u'\u2122': 980, u'$': 500, u'(': 333, u'\xab': 500, u',': 250, u'\xaf': 333, u'0': 500, u'\xb3': 300, u'\u0332': 500, u'4': 500, u'\xb7': 250, u'8': 500, u'\xbb': 500, u'<': 564, u'\xbf': 444, u'@': 921, u'\xc3': 722, u'\u0142': 278, u'D': 722, u'\xc7': 667, u'H': 722, u'\xcb': 611, u'L': 611, u'\xcf': 333, u'P': 556, u'\xd3': 722, u'\u0152': 889, u'T': 611, u'X': 722, u'\xdb': 722, u'\\': 278, u'\xdf': 500, u'\uff64': 500, u'`': 333, u'\xe3': 444, u'\uff62': 500, u'd': 500, u'\xe7': 444, u'\uff66': 500, u'h': 500, u'\xeb': 444, u'\uff6a': 500, u'l': 278, u'\xef': 278, u'\uff6e': 500, u'p': 500, u'\xf3': 500, u'\uff72': 500, u't': 278, u'\uff76': 500, u'x': 500, u'\xfb': 500, u'\uff7a': 500, u'|': 200, u'\xff': 500, u'\u017e': 444, u'\u0301': 333, u'\uff82': 500, u'\u0305': 500, u'\uff86': 500, u'\uff8a': 500, u'\uff8e': 500, u'\u2013': 500, u'\uff92': 500, u'\uff96': 500, u'\uff9a': 500, u'\uff9e': 500, u'#': 500, u'\xa4': 500, u"'": 180, u'\u203a': 333, u'+': 564, u'\xac': 564, u'/': 278, u'\u0131': 278, u'3': 500, u'7': 500, u'\xb8': 333, u';': 278, u'\xbc': 750, u'?': 444, u'\u0141': 611, u'\xc0': 722, u'C': 667, u'\xc4': 722, u'G': 722, u'\xc8': 611, u'K': 722, u'\xcc': 333, u'O': 722, u'\xd0': 722, u'S': 556, u'\u2022': 350, u'\xd4': 722, u'W': 944, u'\uff78': 500, u'\xd8': 722, u'[': 333, u'\xdc': 722, u'_': 500, u'\u0161': 389, u'\xe0': 444, u'c': 444, u'\uff65': 500, u'\xe4': 444, u'g': 500, u'\uff69': 500, u'\xe8': 444, u'k': 500, u'\uff6d': 500, u'\xec': 278, u'o': 500, u'\uff71': 500, u'\xf0': 500, u's': 389, u'\uff75': 500, u'\xf4': 500, u'w': 722, u'\uff79': 500, u'\xf8': 500, u'{': 480, u'\uff7e': 500, u'\u017d': 611, u'\xfc': 500, u'\u0300': 333, u'\uff83': 500, u'\u2002': 500, u'\u0304': 333, u'\uff87': 500, u'\u0308': 333, u'\uff8b': 500, u'\u030c': 333, u'\uff8f': 500, u'\uff93': 500, u'\u2012': 500, u'\uff97': 500, u'\uff9b': 500, u'\u201a': 333, u'\uff9f': 500, u'\u201e': 444, u'\xa1': 333, u'"': 408, u'\xa5': 500, u'&': 778, u'\xa9': 760, u'\u0328': 333, u'*': 500, u'\xad': 564, u'.': 250, u'\uffe8': 500, u'2': 500, u'\xb5': 500, u'6': 500, u'\xb9': 300, u':': 278, u'\xbd': 750, u'>': 564, u'\xc1': 722, u'\uff61': 500, u'B': 667, u'\xc5': 722, u'F': 556, u'\xc9': 611, u'J': 389, u'\xcd': 333, u'N': 722, u'\xd1': 722, u'\u203e': 500, u'R': 667, u'\xd5': 722, u'V': 722, u'\xd9': 722, u'Z': 611, u'\xdd': 722, u'^': 469, u'\xe1': 444, u'\u0160': 556, u'b': 500, u'\xe5': 444, u'\u2039': 333, u'f': 333, u'\xe9': 444, u'\uff68': 500, u'j': 278, u'\xed': 278, u'\uff6c': 500, u'n': 500, u'\xf1': 500, u'\uff70': 500, u'r': 333, u'\xf5': 500, u'\uff74': 500, u'v': 500, u'\xf9': 500, u'\u0178': 722, u'z': 444, u'\xfd': 500, u'\uff7c': 500, u'~': 333, u'\uff80': 500, u'\u0303': 333, u'\uff84': 500, u'\u0307': 333, u'\uff88': 500, u'\u030b': 333, u'\uff8c': 500, u'\u2011': 333, u'\uff90': 500, u'\uff94': 500, u'\uff98': 500, u'\uff9c': 500, u'\u2044': 167, u'!': 333, u'\xa2': 500, u'%': 833, u'\u0327': 333, u'\xa6': 200, u')': 333, u'\xaa': 276, u'-': 333, u'\xae': 760, u'1': 500, u'\xb2': 300, u'5': 500, u'9': 500, u'\xba': 310, u'=': 564, u'\xbe': 750, u'A': 722, u'\u01c0': 200, u'\xc2': 722, u'E': 611, u'\xc6': 889, u'I': 333, u'\xca': 611, u'M': 889, u'\xce': 333, u'Q': 722, u'\u0153': 722, u'\xd2': 722, u'U': 722, u'\xd6': 722, u'Y': 722, u'\ufb01': 556, u'\xda': 722, u']': 333, u'\xde': 556, u'a': 444, u'\uff63': 500, u'\xe2': 444, u'e': 444, u'\uff67': 500, u'\xe6': 667, u'i': 278, u'\uff7d': 500, u'\uff6b': 500, u'\xea': 444, u'm': 778, u'\uff6f': 500, u'\xee': 278, u'q': 500, u'\uff73': 500, u'\xf2': 500, u'u': 500, u'\uff77': 500, u'\xf6': 500, u'y': 500, u'\uff7b': 500, u'\xfa': 500, u'}': 480, u'\uff7f': 500, u'\xfe': 500}
744e4dafbf6e _cidfontdata.py: keep u'' strings
robin
parents: 3794
diff changeset
   468
widthsByUnichar["HYGothic-Medium"] = {u' ': 500, u'$': 500, u'(': 500, u',': 500, u'0': 500, u'4': 500, u'8': 500, u'<': 500, u'@': 500, u'D': 500, u'H': 500, u'L': 500, u'P': 500, u'T': 500, u'X': 500, u'\\': 500, u'`': 500, u'd': 500, u'h': 500, u'l': 500, u'p': 500, u't': 500, u'x': 500, u'|': 500, u'#': 500, u"'": 500, u'+': 500, u'/': 500, u'3': 500, u'7': 500, u';': 500, u'?': 500, u'C': 500, u'G': 500, u'K': 500, u'O': 500, u'S': 500, u'W': 500, u'[': 500, u'_': 500, u'c': 500, u'g': 500, u'k': 500, u'o': 500, u's': 500, u'w': 500, u'{': 500, u'"': 500, u'&': 500, u'*': 500, u'.': 500, u'2': 500, u'6': 500, u':': 500, u'>': 500, u'B': 500, u'F': 500, u'J': 500, u'N': 500, u'R': 500, u'V': 500, u'Z': 500, u'^': 500, u'b': 500, u'f': 500, u'j': 500, u'n': 500, u'r': 500, u'v': 500, u'z': 500, u'!': 500, u'%': 500, u')': 500, u'-': 500, u'1': 500, u'5': 500, u'9': 500, u'=': 500, u'A': 500, u'E': 500, u'I': 500, u'M': 500, u'Q': 500, u'U': 500, u'Y': 500, u']': 500, u'a': 500, u'e': 500, u'i': 500, u'm': 500, u'q': 500, u'u': 500, u'y': 500, u'}': 500}
2629
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   469
1683
7fa753e4420a Removed all trailing whitespace
andy_robinson
parents: 1401
diff changeset
   470
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   471
#shift-jis saying 'This is Heisei-Minchou'
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   472
message1 =  '\202\261\202\352\202\315\225\275\220\254\226\276\222\251\202\305\202\267\201B'
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   473
message2 = '\202\261\202\352\202\315\225\275\220\254\212p\203S\203V\203b\203N\202\305\202\267\201B'
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   474
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   475
##def pswidths(text):
3794
398ea04239b5 string module usage minimization
robin
parents: 3721
diff changeset
   476
##    words = text.split()
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   477
##    out = []
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   478
##    for word in words:
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   479
##        if word == '[':
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   480
##            out.append(word)
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   481
##        else:
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   482
##            out.append(word + ',')
4551
d357e2acc856 improve usage of eval/exec; version --> 3.5.32
robin
parents: 4528
diff changeset
   483
##    return eval(''.join(out),{})