src/reportlab/pdfbase/_cidfontdata.py
author robin
Tue, 19 Nov 2013 13:50:34 +0000
branchpy33
changeset 3794 398ea04239b5
parent 3721 0c93dd8ff567
child 4024 744e4dafbf6e
permissions -rw-r--r--
string module usage minimization
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3617
ae5744e97c42 reportlab: copyright date changes
robin
parents: 3031
diff changeset
     1
#Copyright ReportLab Europe Ltd. 2000-2012
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
     2
#see license.txt for license details
2332
2a7ab4405e18 Remove $Header:, fix CopyRight & history
rgbecker
parents: 1683
diff changeset
     3
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfbase/_cidfontdata.py
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
     4
#$Header $
2332
2a7ab4405e18 Remove $Header:, fix CopyRight & history
rgbecker
parents: 1683
diff changeset
     5
__version__=''' $Id$ '''
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 = {}
3721
0c93dd8ff567 initial changes from 2to3-3.3
rptlab
parents: 3617
diff changeset
   463
widthsByUnichar["MSung-Light"] = {' ': 250, '$': 490, '(': 240, ',': 250, '0': 500, '4': 500, '8': 500, '<': 667, '@': 921, 'D': 760, 'H': 802, 'L': 604, 'P': 563, 'T': 698, 'X': 771, '\\': 520, '`': 250, 'd': 521, 'h': 531, 'l': 240, 'p': 521, 't': 292, 'x': 479, '|': 496, '#': 668, "'": 250, '+': 667, '/': 520, '3': 500, '7': 500, ';': 250, '?': 396, 'C': 719, 'G': 771, 'K': 781, 'O': 823, 'S': 542, 'W': 948, '[': 344, '_': 500, 'c': 427, 'g': 469, 'k': 458, 'o': 500, 's': 333, 'w': 677, '{': 480, '"': 408, '&': 698, '*': 417, '.': 250, '2': 500, '6': 500, ':': 250, '>': 667, 'B': 615, 'F': 552, 'J': 354, 'N': 750, 'R': 729, 'V': 729, 'Z': 635, '^': 469, 'b': 521, 'f': 271, 'j': 250, 'n': 531, 'r': 365, 'v': 458, 'z': 427, '~': 667, '!': 250, '%': 875, ')': 240, '-': 313, '1': 500, '5': 500, '9': 500, '=': 667, 'A': 677, 'E': 625, 'I': 354, 'M': 927, 'Q': 823, 'U': 771, 'Y': 677, ']': 344, 'a': 469, 'e': 438, 'i': 250, 'm': 802, 'q': 521, 'u': 521, 'y': 458, '}': 480}
0c93dd8ff567 initial changes from 2to3-3.3
rptlab
parents: 3617
diff changeset
   464
widthsByUnichar["HeiseiKakuGo-W5"] = {'\uff81': 500, '\uff85': 500, '\uff89': 500, '\uff8d': 500, '\uff91': 500, '\uff95': 500, '\uff99': 500, '\uff9d': 500, ' ': 277, '$': 668, '(': 445, ',': 305, '0': 668, '\u0332': 668, '4': 668, '8': 668, '<': 668, '@': 871, 'D': 699, 'H': 687, 'L': 582, 'P': 582, 'T': 641, 'X': 609, '`': 590, '\uff62': 500, 'd': 602, '\uff66': 500, 'h': 582, '\uff6a': 500, 'l': 234, '\uff6e': 500, 'p': 602, '\uff72': 500, 't': 441, '\uff76': 500, 'x': 531, '\uff7a': 500, '|': 246, '\uff7e': 500, '\uff82': 500, '\uff86': 500, '\uff8a': 500, '\uff8e': 500, '\uff92': 500, '\uff96': 500, '\uff9a': 500, '\uff9e': 500, '#': 668, "'": 305, '+': 668, '/': 539, '3': 668, '7': 668, ';': 305, '?': 566, 'C': 652, 'G': 676, 'K': 664, 'O': 734, 'S': 605, 'W': 945, '[': 445, '_': 668, '\uff61': 500, 'c': 547, '\uff65': 500, 'g': 609, '\uff69': 500, 'k': 539, '\uff6d': 500, 'o': 605, '\uff71': 500, 's': 508, '\uff75': 500, 'w': 781, '\uff79': 500, '{': 449, '\uff7d': 500, '\u0300': 590, '\uff83': 500, '\u2002': 500, '\uff87': 500, '\uff8b': 500, '\uff8f': 500, '\uff93': 500, '\uff97': 500, '\uff9b': 500, '\uff9f': 500, '"': 500, '\xa5': 668, '&': 727, '*': 508, '.': 305, '2': 668, '6': 668, ':': 305, '>': 668, 'B': 637, 'F': 555, 'J': 492, 'N': 707, '\u203e': 500, 'R': 605, 'V': 727, 'Z': 574, '^': 668, 'b': 609, '\uff64': 500, 'f': 391, '\uff68': 500, 'j': 277, '\uff6c': 500, 'n': 582, '\uff70': 500, 'r': 387, '\uff74': 500, 'v': 562, '\uff78': 500, 'z': 555, '\uff7c': 500, '~': 668, '\uff80': 500, '\u0303': 668, '\uff84': 500, '\uff88': 500, '\uff8c': 500, '\u2011': 379, '\uff90': 500, '\uff94': 500, '\uff98': 500, '\uff9c': 500, '!': 305, '%': 906, ')': 445, '-': 379, '1': 668, '5': 668, '9': 668, '=': 668, 'A': 727, 'E': 574, 'I': 242, 'M': 789, 'Q': 734, 'U': 668, 'Y': 609, ']': 445, 'a': 555, '\uff63': 500, 'e': 574, '\uff67': 500, 'i': 234, '\uffe8': 500, '\uff6b': 500, 'm': 895, '\uff6f': 500, 'q': 602, '\uff73': 500, 'u': 582, '\uff77': 500, 'y': 570, '\uff7b': 500, '}': 449, '\uff7f': 500}
0c93dd8ff567 initial changes from 2to3-3.3
rptlab
parents: 3617
diff changeset
   465
widthsByUnichar["HYSMyeongJo-Medium"] = {' ': 333, '$': 625, '(': 500, ',': 291, '0': 625, '4': 625, '8': 625, '<': 833, 'D': 750, 'H': 791, 'L': 666, 'P': 666, 'T': 791, 'X': 708, '\\': 375, '`': 333, 'd': 583, 'h': 583, 'l': 291, 'p': 583, 't': 375, 'x': 625, '|': 583, '#': 833, "'": 250, '+': 833, '/': 375, '3': 625, '7': 625, ';': 333, '?': 500, 'C': 708, 'G': 750, 'K': 791, 'O': 750, 'S': 666, '[': 500, '_': 500, 'c': 541, 'g': 583, 'k': 583, 'o': 583, 's': 541, 'w': 833, '{': 583, '"': 416, '&': 833, '*': 500, '.': 291, '2': 625, '6': 625, ':': 333, '>': 916, 'B': 708, 'F': 666, 'J': 500, 'N': 791, 'R': 708, 'V': 750, 'Z': 666, '^': 500, 'b': 583, 'f': 375, 'j': 333, 'n': 583, 'r': 458, 'v': 583, 'z': 500, '~': 750, '!': 416, '%': 916, ')': 500, '-': 833, '1': 625, '5': 625, '9': 625, '=': 833, 'A': 791, 'E': 708, 'I': 375, 'M': 916, 'Q': 750, 'U': 791, 'Y': 708, ']': 500, 'a': 541, 'e': 583, 'i': 291, 'm': 875, 'q': 583, 'u': 583, 'y': 625, '}': 583}
0c93dd8ff567 initial changes from 2to3-3.3
rptlab
parents: 3617
diff changeset
   466
widthsByUnichar["STSong-Light"] = {' ': 207, '$': 462, '(': 374, ',': 238, '0': 462, '4': 462, '8': 462, '<': 605, '@': 748, 'D': 739, 'H': 793, 'L': 526, 'P': 544, 'T': 607, 'X': 647, '\\': 333, '`': 239, 'd': 529, 'h': 518, 'l': 228, 'p': 524, 't': 277, 'x': 466, '|': 258, '#': 467, "'": 239, '+': 605, '/': 334, '3': 462, '7': 462, ';': 238, '?': 344, 'C': 695, 'G': 729, 'K': 666, 'O': 772, 'S': 465, 'W': 972, '[': 374, '_': 500, 'c': 427, 'g': 444, 'k': 495, 'o': 524, 's': 336, 'w': 652, '{': 370, '"': 342, '&': 710, '*': 423, '.': 238, '2': 462, '6': 462, ':': 238, '>': 605, 'B': 560, 'F': 511, 'J': 312, 'N': 758, 'R': 628, 'V': 711, 'Z': 607, '^': 606, 'b': 503, 'f': 264, 'j': 230, 'n': 527, 'r': 338, 'v': 450, 'z': 407, '~': 605, '!': 270, '%': 797, ')': 374, '-': 375, '1': 462, '5': 462, '9': 462, '=': 605, 'A': 684, 'E': 563, 'I': 318, 'M': 896, 'Q': 772, 'U': 753, 'Y': 620, ']': 374, 'a': 417, 'e': 415, 'i': 241, 'm': 793, 'q': 504, 'u': 517, 'y': 452, '}': 370}
0c93dd8ff567 initial changes from 2to3-3.3
rptlab
parents: 3617
diff changeset
   467
widthsByUnichar["HeiseiMin-W3"] = {'\uff81': 500, '\u0302': 333, '\uff85': 500, '\u0306': 333, '\uff89': 500, '\u030a': 333, '\uff8d': 500, '\uff91': 500, '\ufb02': 556, '\uff95': 500, '\uff99': 500, '\uff9d': 500, ' ': 250, '\xa3': 500, '\u2122': 980, '$': 500, '(': 333, '\xab': 500, ',': 250, '\xaf': 333, '0': 500, '\xb3': 300, '\u0332': 500, '4': 500, '\xb7': 250, '8': 500, '\xbb': 500, '<': 564, '\xbf': 444, '@': 921, '\xc3': 722, '\u0142': 278, 'D': 722, '\xc7': 667, 'H': 722, '\xcb': 611, 'L': 611, '\xcf': 333, 'P': 556, '\xd3': 722, '\u0152': 889, 'T': 611, 'X': 722, '\xdb': 722, '\\': 278, '\xdf': 500, '\uff64': 500, '`': 333, '\xe3': 444, '\uff62': 500, 'd': 500, '\xe7': 444, '\uff66': 500, 'h': 500, '\xeb': 444, '\uff6a': 500, 'l': 278, '\xef': 278, '\uff6e': 500, 'p': 500, '\xf3': 500, '\uff72': 500, 't': 278, '\uff76': 500, 'x': 500, '\xfb': 500, '\uff7a': 500, '|': 200, '\xff': 500, '\u017e': 444, '\u0301': 333, '\uff82': 500, '\u0305': 500, '\uff86': 500, '\uff8a': 500, '\uff8e': 500, '\u2013': 500, '\uff92': 500, '\uff96': 500, '\uff9a': 500, '\uff9e': 500, '#': 500, '\xa4': 500, "'": 180, '\u203a': 333, '+': 564, '\xac': 564, '/': 278, '\u0131': 278, '3': 500, '7': 500, '\xb8': 333, ';': 278, '\xbc': 750, '?': 444, '\u0141': 611, '\xc0': 722, 'C': 667, '\xc4': 722, 'G': 722, '\xc8': 611, 'K': 722, '\xcc': 333, 'O': 722, '\xd0': 722, 'S': 556, '\u2022': 350, '\xd4': 722, 'W': 944, '\uff78': 500, '\xd8': 722, '[': 333, '\xdc': 722, '_': 500, '\u0161': 389, '\xe0': 444, 'c': 444, '\uff65': 500, '\xe4': 444, 'g': 500, '\uff69': 500, '\xe8': 444, 'k': 500, '\uff6d': 500, '\xec': 278, 'o': 500, '\uff71': 500, '\xf0': 500, 's': 389, '\uff75': 500, '\xf4': 500, 'w': 722, '\uff79': 500, '\xf8': 500, '{': 480, '\uff7e': 500, '\u017d': 611, '\xfc': 500, '\u0300': 333, '\uff83': 500, '\u2002': 500, '\u0304': 333, '\uff87': 500, '\u0308': 333, '\uff8b': 500, '\u030c': 333, '\uff8f': 500, '\uff93': 500, '\u2012': 500, '\uff97': 500, '\uff9b': 500, '\u201a': 333, '\uff9f': 500, '\u201e': 444, '\xa1': 333, '"': 408, '\xa5': 500, '&': 778, '\xa9': 760, '\u0328': 333, '*': 500, '\xad': 564, '.': 250, '\uffe8': 500, '2': 500, '\xb5': 500, '6': 500, '\xb9': 300, ':': 278, '\xbd': 750, '>': 564, '\xc1': 722, '\uff61': 500, 'B': 667, '\xc5': 722, 'F': 556, '\xc9': 611, 'J': 389, '\xcd': 333, 'N': 722, '\xd1': 722, '\u203e': 500, 'R': 667, '\xd5': 722, 'V': 722, '\xd9': 722, 'Z': 611, '\xdd': 722, '^': 469, '\xe1': 444, '\u0160': 556, 'b': 500, '\xe5': 444, '\u2039': 333, 'f': 333, '\xe9': 444, '\uff68': 500, 'j': 278, '\xed': 278, '\uff6c': 500, 'n': 500, '\xf1': 500, '\uff70': 500, 'r': 333, '\xf5': 500, '\uff74': 500, 'v': 500, '\xf9': 500, '\u0178': 722, 'z': 444, '\xfd': 500, '\uff7c': 500, '~': 333, '\uff80': 500, '\u0303': 333, '\uff84': 500, '\u0307': 333, '\uff88': 500, '\u030b': 333, '\uff8c': 500, '\u2011': 333, '\uff90': 500, '\uff94': 500, '\uff98': 500, '\uff9c': 500, '\u2044': 167, '!': 333, '\xa2': 500, '%': 833, '\u0327': 333, '\xa6': 200, ')': 333, '\xaa': 276, '-': 333, '\xae': 760, '1': 500, '\xb2': 300, '5': 500, '9': 500, '\xba': 310, '=': 564, '\xbe': 750, 'A': 722, '\u01c0': 200, '\xc2': 722, 'E': 611, '\xc6': 889, 'I': 333, '\xca': 611, 'M': 889, '\xce': 333, 'Q': 722, '\u0153': 722, '\xd2': 722, 'U': 722, '\xd6': 722, 'Y': 722, '\ufb01': 556, '\xda': 722, ']': 333, '\xde': 556, 'a': 444, '\uff63': 500, '\xe2': 444, 'e': 444, '\uff67': 500, '\xe6': 667, 'i': 278, '\uff7d': 500, '\uff6b': 500, '\xea': 444, 'm': 778, '\uff6f': 500, '\xee': 278, 'q': 500, '\uff73': 500, '\xf2': 500, 'u': 500, '\uff77': 500, '\xf6': 500, 'y': 500, '\uff7b': 500, '\xfa': 500, '}': 480, '\uff7f': 500, '\xfe': 500}
0c93dd8ff567 initial changes from 2to3-3.3
rptlab
parents: 3617
diff changeset
   468
widthsByUnichar["HYGothic-Medium"] = {' ': 500, '$': 500, '(': 500, ',': 500, '0': 500, '4': 500, '8': 500, '<': 500, '@': 500, 'D': 500, 'H': 500, 'L': 500, 'P': 500, 'T': 500, 'X': 500, '\\': 500, '`': 500, 'd': 500, 'h': 500, 'l': 500, 'p': 500, 't': 500, 'x': 500, '|': 500, '#': 500, "'": 500, '+': 500, '/': 500, '3': 500, '7': 500, ';': 500, '?': 500, 'C': 500, 'G': 500, 'K': 500, 'O': 500, 'S': 500, 'W': 500, '[': 500, '_': 500, 'c': 500, 'g': 500, 'k': 500, 'o': 500, 's': 500, 'w': 500, '{': 500, '"': 500, '&': 500, '*': 500, '.': 500, '2': 500, '6': 500, ':': 500, '>': 500, 'B': 500, 'F': 500, 'J': 500, 'N': 500, 'R': 500, 'V': 500, 'Z': 500, '^': 500, 'b': 500, 'f': 500, 'j': 500, 'n': 500, 'r': 500, 'v': 500, 'z': 500, '!': 500, '%': 500, ')': 500, '-': 500, '1': 500, '5': 500, '9': 500, '=': 500, 'A': 500, 'E': 500, 'I': 500, 'M': 500, 'Q': 500, 'U': 500, 'Y': 500, ']': 500, 'a': 500, 'e': 500, 'i': 500, 'm': 500, 'q': 500, 'u': 500, 'y': 500, '}': 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 + ',')
3794
398ea04239b5 string module usage minimization
robin
parents: 3721
diff changeset
   483
##    return eval(''.join(out))