src/reportlab/pdfbase/_cidfontdata.py
author rgbecker
Wed, 03 Sep 2008 16:10:51 +0000
changeset 2964 32352db0d71e
parent 2629 reportlab/pdfbase/_cidfontdata.py@3f42be5bfbfc
child 3031 6f90e7668adb
permissions -rw-r--r--
reportlab-2.2: second stage of major re-org
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2332
2a7ab4405e18 Remove $Header:, fix CopyRight & history
rgbecker
parents: 1683
diff changeset
     1
#Copyright ReportLab Europe Ltd. 2000-2004
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
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    18
prefixes':
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    19
   chs = Chinese Simplified (mainland)
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    20
   cht = Chinese Traditional (Taiwan)
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    21
   kor = Korean
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    22
   jpn = Japanese
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    23
"""
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
    24
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
    25
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
    26
languages = ['jpn', 'kor', 'cht', 'chs']
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    27
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    28
#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
    29
#for a specific language
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
    30
typeFaces_chs = ['STSong-Light'] # to do
2629
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
    31
typeFaces_cht = ['MSung-Light']  #, 'MHei-Medium'] # to do
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    32
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
    33
typeFaces_kor = ['HYSMyeongJo-Medium','HYGothic-Medium']
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    34
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    35
allowedTypeFaces = typeFaces_chs + typeFaces_cht + typeFaces_jpn + typeFaces_kor
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    36
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
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
    39
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    40
encodings_jpn = [
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    41
    # official encoding names, comments taken verbatim from PDF Spec
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    42
    '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
    43
                        #extensions, Shift-JIS encoding, Script Manager code 1
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    44
    '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
    45
                        #character set with NEC and IBM extensions
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    46
    '90ms-RKSJ-V',      #Vertical version of 90ms-RKSJ-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    47
    '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
    48
                        #characters with proportional forms
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    49
    '90msp-RKSJ-V',     #Vertical version of 90msp-RKSJ-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    50
    '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
    51
                        #extensions, Shift-JIS encoding, Script Manager code 1
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    52
    '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
    53
                        #Shift-JIS encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    54
    'Add-RKSJ-V',       #Vertical version of Add-RKSJ-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    55
    'EUC-H',            #JIS X 0208 character set, EUC-JP encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    56
    'EUC-V',            #Vertical version of EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    57
    '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
    58
                        #Shift-JIS encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    59
    'Ext-RKSJ-V',       #Vertical version of Ext-RKSJ-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    60
    'H',                #JIS X 0208 character set, ISO-2022-JP encoding,
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    61
    'V',                #Vertical version of H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    62
    '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
    63
                        #collection
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    64
    'UniJIS-UCS2-V',    #Vertical version of UniJIS-UCS2-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    65
    '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
    66
                        #characters with half-width forms
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    67
    '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
    68
    ]
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    69
encodings_kor = [
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    70
    '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
    71
    'KSC-EUC-V',        # Vertical version of KSC-EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    72
    '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
    73
                        #character set plus 8,822 additional hangul, Unified Hangul
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    74
                        #Code (UHC) encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    75
    'KSCms-UHC-V',      #Vertical version of KSCms-UHC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    76
    '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
    77
                        # characters with halfwidth forms
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    78
    '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
    79
    '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
    80
                        #extensions, Script Manager Code 3
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    81
    '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
    82
    'UniKS-UCS2-V'      #Vertical version of UniKS-UCS2-H
1683
7fa753e4420a Removed all trailing whitespace
andy_robinson
parents: 1401
diff changeset
    83
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    84
    ]
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
    85
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    86
encodings_chs = [
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    87
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    88
    '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
    89
                        # character set, EUC-CN encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    90
    'GB-EUC-V',         # Vertical version of GB-EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    91
    '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
    92
                        # Script Manager code 2
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    93
    'GBpc-EUC-V',       # Vertical version of GBpc-EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    94
    '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
    95
                        # set, GBK encoding
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    96
    'GBK-EUC-V',        # Vertical version of GBK-EUC-V
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    97
    '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
    98
                        # character collection
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
    99
    'UniGB-UCS2-V'     # Vertical version of UniGB-UCS2-H.
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   100
    ]
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
encodings_cht = [
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   103
    'B5pc-H',           # Macintosh, Big Five character set, Big Five encoding,
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   104
                        # Script Manager code 2
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   105
    'B5pc-V',           # Vertical version of B5pc-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   106
    '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
   107
                        # character set with ETen extensions
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   108
    'ETen-B5-V',        # Vertical version of ETen-B5-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   109
    '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
   110
                        # character set with ETen extensions; this uses proportional
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   111
                        # forms for half-width Latin characters.
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   112
    'ETenms-B5-V',      # Vertical version of ETenms-B5-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   113
    '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
   114
    'CNS-EUC-V',        # Vertical version of CNS-EUC-H
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   115
    '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
   116
                        # character collection
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   117
    'UniCNS-UCS2-V'    # Vertical version of UniCNS-UCS2-H.
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   118
    ]
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   119
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   120
# the Identity encodings simply dump out all character
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   121
# in the font in the order they were defined.
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   122
allowedEncodings = (['Identity-H', 'Identity-V'] +
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   123
                    encodings_chs +
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   124
                    encodings_cht +
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   125
                    encodings_jpn +
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   126
                    encodings_kor
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   127
                    )
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   128
2575
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   129
defaultUnicodeEncodings = {
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   130
    #we ddefine a default Unicode encoding for each face name;
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   131
    #this should be the most commonly used horizontal unicode encoding;
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   132
    #also define a 3-letter language code.
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   133
    'HeiseiMin-W3': ('jpn','UniJIS-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   134
    'HeiseiKakuGo-W5': ('jpn','UniJIS-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   135
    'STSong-Light': ('chs', 'UniGB-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   136
    'MSung-Light': ('cht', 'UniGB-UCS2-H'),
2629
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   137
    #'MHei-Medium': ('cht', 'UniGB-UCS2-H'),
2575
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   138
    'HYSMyeongJo-Medium': ('kor', 'UniKS-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   139
    'HYGothic-Medium': ('kor','UniKS-UCS2-H'),
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   140
    }
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   141
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   142
typeFaces_chs = ['STSong-Light'] # to do
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   143
typeFaces_cht = ['MSung-Light', 'MHei-Medium'] # to do
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   144
typeFaces_jpn = ['HeiseiMin-W3', 'HeiseiKakuGo-W5']
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   145
typeFaces_kor = ['HYSMyeongJo-Medium','HYGothic-Medium']
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   146
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   147
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   148
#declare separately those used for unicode
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   149
unicode_encodings = [enc for enc in allowedEncodings if 'UCS2' in enc]
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   150
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   151
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   152
CIDFontInfo = {}
1249
f46b448d60fa Expanded allowed encodings, added more comprehensive tests
andy_robinson
parents: 1192
diff changeset
   153
#statically describe the fonts in Adobe's Japanese Language Packs
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   154
CIDFontInfo['HeiseiMin-W3'] = {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   155
            'Type':'/Font',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   156
            'Subtype':'/Type0',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   157
            'Name': '/%(internalName)s' , #<-- the internal name
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   158
            'BaseFont': '/HeiseiMin-W3',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   159
            'Encoding': '/%(encodings)s',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   160
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   161
            #there could be several descendant fonts if it is an old-style
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   162
            #type 0 compound font.  For CID fonts there is just one.
1683
7fa753e4420a Removed all trailing whitespace
andy_robinson
parents: 1401
diff changeset
   163
            'DescendantFonts': [{
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   164
                'Type':'/Font',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   165
                'Subtype':'/CIDFontType0',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   166
                'BaseFont':'/HeiseiMin-W3',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   167
                'FontDescriptor': {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   168
                    'Type': '/FontDescriptor',
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   169
                    'Ascent': 723,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   170
                    'CapHeight': 709,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   171
                    'Descent': -241,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   172
                    'Flags': 6,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   173
                    'FontBBox': (-123, -257, 1001, 910),
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   174
                    'FontName': '/HeiseiMin-W3',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   175
                    'ItalicAngle': 0,
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   176
                    'StemV': 69,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   177
                    'XHeight': 450#,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   178
#                    'Style': {'Panose': '<010502020400000000000000>'}
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   179
                    },
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   180
                'CIDSystemInfo': {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   181
                    'Registry': '(Adobe)',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   182
                    'Ordering': '(Japan1)',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   183
                    'Supplement': 2
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   184
                    },
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   185
                #default width is 1000 em units
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   186
                'DW': 1000,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   187
                #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
   188
                'W': [1, [250, 333, 408, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   189
                      5, [500, 833, 778, 180, 333],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   190
                      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
   191
                      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
   192
                      32, [444, 921, 722, 667],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   193
                      36, [667, 722, 611, 556, 722],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   194
                      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
   195
                      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
   196
                      55, [722, 944, 722],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   197
                      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
   198
                           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
   199
                      73, [500, 278],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   200
                      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
   201
                      83, [333, 389, 278, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   202
                      87, [500, 722, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   203
                      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
   204
                      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
   205
                      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
   206
                      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
   207
                      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
   208
                      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
   209
                      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
   210
                      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
   211
                      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
   212
                      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
   213
                      [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
   214
                      214, 500, 216, 222, 500,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   215
                      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
   216
                      231, [500], 323, [500], 325, [500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   217
                      327, 389, 500]
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   218
##                'W': (
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   219
##                    # 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
   220
##                    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
   221
##                    # 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
   222
##                    17, 26, 668,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   223
##                    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
   224
##                         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
   225
##                         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
   226
##                         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
   227
##                         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
   228
##                         449, 246, 449, 668),
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   229
##                    # 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
   230
##                    231, 632, 500
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   231
##                    )
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   232
                }]# end list of descendant fonts
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   233
            } #end HeiseiMin-W3
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   234
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   235
CIDFontInfo['HeiseiKakuGo-W5'] =  {'Type':'/Font',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   236
            'Subtype':'/Type0',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   237
            'Name': '/%(internalName)s', #<-- the internal name
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   238
            'BaseFont': '/HeiseiKakuGo-W5',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   239
            'Encoding': '/%(encodings)s',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   240
            'DescendantFonts': [{'Type':'/Font',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   241
                'Subtype':'/CIDFontType0',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   242
                'BaseFont':'/HeiseiKakuGo-W5',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   243
                'FontDescriptor': {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   244
                    'Type': '/FontDescriptor',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   245
                    'Ascent': 752,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   246
                    'CapHeight': 737,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   247
                    'Descent': -221,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   248
                    'Flags': 4,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   249
                    'FontBBox': [-92, -250, 1010, 922],
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   250
                    'FontName': '/HeiseKakuGo-W5',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   251
                    'ItalicAngle': 0,
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   252
                    'StemH': 0,
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   253
                    'StemV': 114,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   254
                    'XHeight': 553,
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   255
##                    'Style': {'Panose': '<0801020b0600000000000000>'}
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   256
                    },
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   257
                'CIDSystemInfo': {
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   258
                    'Registry': '(Adobe)',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   259
                    'Ordering': '(Japan1)',
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   260
                    'Supplement': 2
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   261
                    },
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   262
                'DW': 1000,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   263
                'W': (
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   264
                    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
   265
                    17, 26, 668,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   266
                    27, (305, 305, 668, 668, 668, 566, 871, 727, 637, 652, 699, 574, 555,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   267
                                         676, 687, 242, 492, 664, 582, 789, 707, 734, 582, 734, 605, 605,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   268
                                         641, 668, 727, 945, 609, 609, 574, 445, 668, 445, 668, 668, 590,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   269
                                         555, 609, 547, 602, 574, 391, 609, 582, 234, 277, 539, 234, 895,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   270
                                         582, 605, 602, 602, 387, 508, 441, 582, 562, 781, 531, 570, 555,
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   271
                                         449, 246, 449, 668),
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   272
                    231, 632, 500
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   273
                    )
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   274
                }] # end descendant fonts
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   275
            }
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   276
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   277
CIDFontInfo['HYGothic-Medium'] =  {'Type':'/Font',
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   278
            'Subtype':'/Type0',
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   279
            'Name': '/%(internalName)s', #<-- the internal name
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   280
            'BaseFont': '/' + 'HYGothic-Medium',
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   281
            'Encoding': '/%(encodings)s',
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   282
            'DescendantFonts': [{'Type':'/Font',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   283
                'Subtype':'/CIDFontType0',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   284
                'BaseFont':'/'+'HYGothic-Medium',
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   285
                'FontDescriptor': {
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   286
                    'Type': '/FontDescriptor',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   287
                    'Ascent': 752,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   288
                    'AvgWidth': -271,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   289
                    'CapHeight': 737,
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   290
                    'Descent': -142,
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   291
                    'Flags': 6,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   292
                    'FontBBox': [-6, -145, 1003, 880],
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   293
                    'FontName': '/'+'HYSMyeongJo-Medium',
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   294
                    'ItalicAngle': 0,
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   295
                    'Leading': 148,
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   296
                    'MaxWidth': 1000,
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   297
                    'MissingWidth': 500,
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   298
                    'StemH': 0,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   299
                    'StemV': 58,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   300
                    'XHeight': 553
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   301
                    },
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   302
                'CIDSystemInfo': {
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   303
                    'Registry': '(Adobe)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   304
                    'Ordering': '(Korea1)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   305
                    'Supplement': 1
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   306
                    },
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   307
                'DW': 1000,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   308
                'W': (1, 94, 500)
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   309
                }] # end descendant fonts
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   310
            }
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   311
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   312
CIDFontInfo['HYSMyeongJo-Medium'] =  {'Type':'/Font',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   313
            'Subtype':'/Type0',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   314
            '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
   315
            'BaseFont': '/' + 'HYSMyeongJo-Medium',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   316
            'Encoding': '/%(encodings)s',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   317
            'DescendantFonts': [{'Type':'/Font',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   318
                'Subtype':'/CIDFontType2',
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   319
                'BaseFont':'/'+'HYSMyeongJo-Medium',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   320
                'FontDescriptor': {
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   321
                    'Type': '/FontDescriptor',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   322
                    'Ascent': 752,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   323
                    'AvgWidth': 500,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   324
                    'CapHeight': 737,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   325
                    'Descent': -271,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   326
                    'Flags': 6,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   327
                    'FontBBox': [0, -148, 1001, 880],
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   328
                    'FontName': '/'+'HYSMyeongJo-Medium',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   329
                    'ItalicAngle': 0,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   330
                    'Leading': 148,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   331
                    'MaxWidth': 1000,
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   332
                    'MissingWidth': 500,
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   333
                    'StemH': 91,
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   334
                    'StemV': 58,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   335
                    'XHeight': 553
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   336
                    },
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   337
                'CIDSystemInfo': {
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   338
                    'Registry': '(Adobe)',
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   339
                    'Ordering': '(Korea1)',
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   340
                    'Supplement': 1
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   341
                    },
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   342
                'DW': 1000,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   343
                'W': [1, [333, 416],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   344
                      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
   345
                      10, 11, 500,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   346
                      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
   347
                      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
   348
                      31, [916, 500, 1000, 791, 708],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   349
                      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
   350
                           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
   351
                           750, 708, 666, 791],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   352
                      54, [791, 750, 1000, 708],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   353
                      58, [708, 666, 500, 375, 500],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   354
                      63, 64, 500,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   355
                      65, [333, 541, 583, 541, 583],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   356
                      70, [583, 375, 583],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   357
                      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
   358
                      80, 82, 583,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   359
                      83, [458, 541, 375, 583],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   360
                      87, [583, 833, 625],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   361
                      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
   362
                      95, [750]
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   363
                      ]
1192
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   364
                }] # end descendant fonts
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   365
            }
08043d817140 Added a trivial korean test, prior to testing on another machine
andy_robinson
parents: 1180
diff changeset
   366
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   367
#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
   368
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   369
CIDFontInfo['STSong-Light'] =  {'Type':'/Font',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   370
            'Subtype':'/Type0',
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   371
            'Name': '/%(internalName)s', #<-- the internal name
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   372
            'BaseFont': '/' + 'STSong-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   373
            'Encoding': '/%(encodings)s',
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   374
            'DescendantFonts': [{'Type':'/Font',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   375
                'Subtype':'/CIDFontType0',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   376
                'BaseFont':'/'+'STSong-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   377
                'FontDescriptor': {
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   378
                    'Type': '/FontDescriptor',
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   379
                    'Ascent': 752,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   380
                    'CapHeight': 737,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   381
                    'Descent': -271,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   382
                    'Flags': 6,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   383
                    'FontBBox': [-25, -254, 1000, 880],
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   384
                    'FontName': '/'+'STSongStd-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   385
                    'ItalicAngle': 0,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   386
                    'Leading': 148,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   387
                    'MaxWidth': 1000,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   388
                    'MissingWidth': 500,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   389
                    'StemH': 91,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   390
                    'StemV': 58,
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   391
                    'XHeight': 553
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   392
                    },
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   393
                'CIDSystemInfo': {
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   394
                    'Registry': '(Adobe)',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   395
                    'Ordering': '(GB1)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   396
                    'Supplement': 0
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   397
                    },
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   398
                'DW': 1000,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   399
                '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
   400
                      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
   401
                      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
   402
                      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
   403
                           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
   404
                           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
   405
                           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
   406
                           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
   407
                           228, 793, 527, 524],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   408
                      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
   409
                           452, 407, 370, 258, 370, 605]
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   410
                      ]
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   411
                }] # end descendant fonts
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   412
            }
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   413
CIDFontInfo['MSung-Light'] =  {'Type':'/Font',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   414
            'Subtype':'/Type0',
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   415
            'Name': '/%(internalName)s', #<-- the internal name
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   416
            'BaseFont': '/' + 'MSung-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   417
            'Encoding': '/%(encodings)s',
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   418
            'DescendantFonts': [{'Type':'/Font',
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   419
                'Subtype':'/CIDFontType0',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   420
                'BaseFont':'/'+'MSung-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   421
                'FontDescriptor': {
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   422
                    'Type': '/FontDescriptor',
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   423
                    'Ascent': 752,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   424
                    'CapHeight': 737,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   425
                    'Descent': -271,
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   426
                    'Flags': 6,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   427
                    'FontBBox': [-160, -249, 1015, 888],
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   428
                    'FontName': '/'+'MSung-Light',
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   429
                    'ItalicAngle': 0,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   430
                    'Leading': 148,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   431
                    'MaxWidth': 1000,
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   432
                    'MissingWidth': 500,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   433
                    'StemH': 45,
1376
62377604c367 Moved manual building tools to tools/docco in order to (a)
andy_robinson
parents: 1363
diff changeset
   434
                    'StemV': 58,
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   435
                    'XHeight': 553
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   436
                    },
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   437
                'CIDSystemInfo': {
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   438
                    'Registry': '(Adobe)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   439
                    'Ordering': '(CNS1)',
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   440
                    'Supplement': 1
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   441
                    },
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   442
                'DW': 1000,
1401
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   443
                '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
   444
                      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
   445
                      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
   446
                      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
   447
                           802, 354],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   448
                      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
   449
                           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
   450
                           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
   451
                           438, 271, 469, 531, 250],
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   452
                      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
   453
                      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
   454
                           427, 480, 496, 480, 667]]
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   455
1378
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   456
                }] # end descendant fonts
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   457
            }
796ce78d458a Fixed font registry entries, tidied up stringWidth tests
andy_robinson
parents: 1376
diff changeset
   458
1265
f11478b89928 Initial (inaccurate metrics?) support for chinese simplified and traditional
andy_robinson
parents: 1249
diff changeset
   459
2629
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   460
#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
   461
widthsByUnichar = {}
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   462
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}
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   463
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}
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   464
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}
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   465
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}
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   466
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}
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   467
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}
3f42be5bfbfc added canned width data for CID fonts
andy
parents: 2575
diff changeset
   468
1683
7fa753e4420a Removed all trailing whitespace
andy_robinson
parents: 1401
diff changeset
   469
1180
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   470
#shift-jis saying 'This is Heisei-Minchou'
1961429ad6f4 Japanese Fonts checked in
andy_robinson
parents:
diff changeset
   471
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
   472
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
   473
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   474
##def pswidths(text):
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   475
##    import string
22c6eb2165d8 Full (?) set of widths added for Asian fonts by using Asian
andy_robinson
parents: 1378
diff changeset
   476
##    words = string.split(text)
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 + ',')
2575
0cba68b93555 reportlab-utf8 moved to trunk
rgbecker
parents: 2332
diff changeset
   483
##    return eval(string.join(out, ''))