Python和科学计算认证群组  - 讨论区

标题:中文字体问题

2011年02月14日 星期一 11:13

昨天发帖关于中文字体问题,在下面链接中得到解决: http://www.zeuux.org/group/scipython/bbs/content/6270/

但是有个新的问题,当我将C:\WINDOWS\Fonts 中的中文字体:

FZSTK,FZYTK,msyh,msyhbd,simfang,simhei,simkai,SIMLI,simsun,SimSun18030,SIMYOU,STCAIYUN,STFANGSO,STXIHEI,STXINGKA,STXINWEI,STZHONGS,SURSONG

复制到C:\Python26\Lib\site-packages\matplotlib\mpl-data\fonts\ttf 中

将字体添加到 C:\Python26\Lib\site-packages\matplotlib\mpl-data\matplotlibrc 文件中的 font.sans-serif:后

 

运行下列程序:

# -*- coding: utf-8 -*-

import numpy as np
import matplotlib.pyplot as plt


plt.figure(figsize=(8,4))

plt.xlabel(u"STZHONGS.TTF 华文中宋",            fontproperties='STZHONGS')
plt.ylabel(u"SURSONG.TTF  宋体-方正超大字符集", fontproperties='SURSONG')

plt.text(0.35, 0.95, u"Default Font  缺省字体")
#左列
plt.text(0.05, 0.85, u"FZSTK.TTF        方正舒体",           fontproperties='FZSTK')
plt.text(0.05, 0.75, u"FZYTK.TTF        方正姚体",           fontproperties='FZYTK')
plt.text(0.05, 0.65, u"msyh.ttf         微软雅黑 ",          fontproperties='msyh')
plt.text(0.05, 0.55, u"msyhbd.ttf       微软雅黑黑体",       fontproperties='msyhbd')
plt.text(0.05, 0.45, u"simfang.ttf      仿宋体 ",            fontproperties='simfang')
plt.text(0.05, 0.35, u"simhei.ttf       黑体",               fontproperties='simhei')
plt.text(0.05, 0.25, u"simkai.ttf       楷体",               fontproperties='simkai')
plt.text(0.05, 0.15, u"SIMLI.TTF        隶书",               fontproperties='SIMLI')
#右列
plt.text(0.55, 0.85, u"simsun.ttc       宋体 & 新宋体",      fontproperties='simsun')
plt.text(0.55, 0.75, u"SimSun18030.ttc  宋体18030",          fontproperties='SimSun18030')
plt.text(0.55, 0.65, u"SIMYOU.TTF       幼圆",               fontproperties='SIMYOU')
plt.text(0.55, 0.55, u"STCAIYUN.TTF     华文彩云",           fontproperties='STCAIYUN')
plt.text(0.55, 0.45, u"STFANGSO.TTF     华文仿宋",           fontproperties='STFANGSO')
plt.text(0.55, 0.35, u"STXIHEI.TTF      华文细黑",           fontproperties='STXIHEI')
plt.text(0.55, 0.25, u"STXINGKA.TTF     华文行楷",           fontproperties='STXINGKA')
plt.text(0.55, 0.15, u"STXINWEI.TTF     华文新魏",           fontproperties='STXINWEI')

plt.show()

出现下面错误:

有的字体可以显示,有的不能显示

 

 

 

 

2011年02月14日 星期一 14:51

运行一下下面的程序,看看你的字体是否在这个列表中,字体名是否正确:

>>> import matplotlib

>>> matplotlib.font_manager.fontManager.ttflist

2011年02月15日 星期二 13:01

谢谢

有错误,我试验了

要这种写,

from matplotlib import font_manager

print font_manager.fontManager.ttflist

2011年02月15日 星期二 14:40

结果为:

fzstk : False
fzytk : False
msyh : False
msyhbd : False
simfang : False
simhei : True c:\windows\fonts\simhei.ttf
simkai : False
simli : False
simsun : False
simsun18030 : False
simyou : False
stcaiyun : True c:\windows\fonts\stcaiyun.ttf
stfangso : False
stxihei : True c:\windows\fonts\stxihei.ttf
stxingka : False
stxinwei : True C:\WINDOWS\Fonts\STXINWEI.TTF
stzhongs : False
sursong : False

我已经将C:\WINDOWS\Fonts下的中文字体拷贝到C:\Python26\Lib\site-packages\matplotlib\mpl-data\fonts\ttf 中了,但还是找不到

2011年02月15日 星期二 20:58

用下面的程序可以查看每个字体的文件名和字体名,找不到的字体可能是你用的字体名不对:

from matplotlib.font_manager import fontManager

 

from os.path import split

fonts = [(split(font.fname)[-1], font.name) for font in fontManager.ttflist]

fonts.sort()

for font in fonts:

    print font

 

例如('simkai.ttf', 'KaiTi')

 

2011年02月16日 星期三 08:29

('ACaslonPro-Bold.otf', 'Adobe Caslon Pro')
('ACaslonPro-BoldItalic.otf', 'Adobe Caslon Pro')
('ACaslonPro-Italic.otf', 'Adobe Caslon Pro')
('ACaslonPro-Regular.otf', 'Adobe Caslon Pro')
('ACaslonPro-Semibold.otf', 'Adobe Caslon Pro')
('ACaslonPro-SemiboldItalic.otf', 'Adobe Caslon Pro')
('AGaramondPro-Bold.otf', 'Adobe Garamond Pro')
('AGaramondPro-BoldItalic.otf', 'Adobe Garamond Pro')
('AGaramondPro-Italic.otf', 'Adobe Garamond Pro')
('AGaramondPro-Regular.otf', 'Adobe Garamond Pro')
('ANTQUAB.TTF', 'Book Antiqua')
('ANTQUABI.TTF', 'Book Antiqua')
('ANTQUAI.TTF', 'Book Antiqua')
('ARIALN.TTF', 'Arial Narrow')
('ARIALNB.TTF', 'Arial Narrow')
('ARIALNBI.TTF', 'Arial Narrow')
('ARIALNI.TTF', 'Arial Narrow')
('AdobeFangsongStd-Regular.otf', 'Adobe Fangsong Std')
('AdobeHeitiStd-Regular.otf', 'Adobe Heiti Std')
('AdobeKaitiStd-Regular.otf', 'Adobe Kaiti Std')
('AdobeMingStd-Light.otf', 'Adobe Ming Std')
('AdobeMyungjoStd-Medium.otf', 'Adobe Myungjo Std')
('AdobeSongStd-Light.otf', 'Adobe Song Std')
('BKANT.TTF', 'Book Antiqua')
('BOOKOS.TTF', 'Bookman Old Style')
('BOOKOSB.TTF', 'Bookman Old Style')
('BOOKOSBI.TTF', 'Bookman Old Style')
('BOOKOSI.TTF', 'Bookman Old Style')
('BSSYM7.TTF', 'Bookshelf Symbol 7')
('BellGothicStd-Black.otf', 'Bell Gothic Std')
('BellGothicStd-Bold.otf', 'Bell Gothic Std')
('BirchStd.otf', 'Birch Std')
('BlackoakStd.otf', 'Blackoak Std')
('BrushScriptStd.otf', 'Brush Script Std')
('CALIBRI.TTF', 'Calibri')
('CALIBRIB.TTF', 'Calibri')
('CALIBRII.TTF', 'Calibri')
('CALIBRIZ.TTF', 'Calibri')
('CAMBRIAB.TTF', 'Cambria')
('CAMBRIAI.TTF', 'Cambria')
('CAMBRIAZ.TTF', 'Cambria')
('CANDARA.TTF', 'Candara')
('CANDARAB.TTF', 'Candara')
('CANDARAI.TTF', 'Candara')
('CANDARAZ.TTF', 'Candara')
('CONSOLA.TTF', 'Consolas')
('CONSOLAB.TTF', 'Consolas')
('CONSOLAI.TTF', 'Consolas')
('CONSOLAZ.TTF', 'Consolas')
('CONSTAN.TTF', 'Constantia')
('CONSTANB.TTF', 'Constantia')
('CONSTANI.TTF', 'Constantia')
('CONSTANZ.TTF', 'Constantia')
('CORBEL.TTF', 'Corbel')
('CORBELB.TTF', 'Corbel')
('CORBELI.TTF', 'Corbel')
('CORBELZ.TTF', 'Corbel')
('ChaparralPro-Bold.otf', 'Chaparral Pro')
('ChaparralPro-BoldIt.otf', 'Chaparral Pro')
('ChaparralPro-Italic.otf', 'Chaparral Pro')
('ChaparralPro-Regular.otf', 'Chaparral Pro')
('CharlemagneStd-Bold.otf', 'Charlemagne Std')
('CooperBlackStd-Italic.otf', 'Cooper Std')
('CooperBlackStd.otf', 'Cooper Std')
('EccentricStd.otf', 'Eccentric Std')
('FZSTK.TTF', 'FZShuTi')
('FZYTK.TTF', 'FZYaoTi')
('GARA.TTF', 'Garamond')
('GARABD.TTF', 'Garamond')
('GARAIT.TTF', 'Garamond')
('GOTHIC.TTF', 'Century Gothic')
('GOTHICB.TTF', 'Century Gothic')
('GOTHICBI.TTF', 'Century Gothic')
('GOTHICI.TTF', 'Century Gothic')
('GSDidger1.ttf', 'GSI Didger')
('GSGeol1.ttf', 'GSI Geologic Symbols')
('GSMap1.ttf', 'GSI Map Symbols')
('GSNArrow.ttf', 'GSI North Arrows')
('GSOandG1.ttf', 'GSI Oil and Gas')
('GSWBarb1.ttf', 'GSI Wind Barb Symbols')
('GSWeath1.ttf', 'GSI Weather Symbols')
('GiddyupStd.otf', 'Giddyup Std')
('HoboStd.otf', 'Hobo Std')
('KozGoPro-Bold.otf', 'Kozuka Gothic Pro')
('KozGoPro-ExtraLight.otf', 'Kozuka Gothic Pro')
('KozGoPro-Heavy.otf', 'Kozuka Gothic Pro')
('KozGoPro-Light.otf', 'Kozuka Gothic Pro')
('KozGoPro-Medium.otf', 'Kozuka Gothic Pro')
('KozGoPro-Regular.otf', 'Kozuka Gothic Pro')
('KozMinPro-Bold.otf', 'Kozuka Mincho Pro')
('KozMinPro-ExtraLight.otf', 'Kozuka Mincho Pro')
('KozMinPro-Heavy.otf', 'Kozuka Mincho Pro')
('KozMinPro-Light.otf', 'Kozuka Mincho Pro')
('KozMinPro-Medium.otf', 'Kozuka Mincho Pro')
('KozMinPro-Regular.otf', 'Kozuka Mincho Pro')
('LetterGothicStd-Bold.otf', 'Letter Gothic Std')
('LetterGothicStd-BoldSlanted.otf', 'Letter Gothic Std')
('LetterGothicStd-Slanted.otf', 'Letter Gothic Std')
('LetterGothicStd.otf', 'Letter Gothic Std')
('LithosPro-Black.otf', 'Lithos Pro')
('LithosPro-Regular.otf', 'Lithos Pro')
('MTCORSVA.TTF', 'Monotype Corsiva')
('MesquiteStd.otf', 'Mesquite Std')
('MinionPro-Bold.otf', 'Minion Pro')
('MinionPro-BoldCn.otf', 'Minion Pro')
('MinionPro-BoldCnIt.otf', 'Minion Pro')
('MinionPro-BoldIt.otf', 'Minion Pro')
('MinionPro-It.otf', 'Minion Pro')
('MinionPro-Medium.otf', 'Minion Pro')
('MinionPro-MediumIt.otf', 'Minion Pro')
('MinionPro-Regular.otf', 'Minion Pro')
('MinionPro-Semibold.otf', 'Minion Pro')
('MinionPro-SemiboldIt.otf', 'Minion Pro')
('MyriadPro-Bold.otf', 'Myriad Pro')
('MyriadPro-BoldCond.otf', 'Myriad Pro')
('MyriadPro-BoldCondIt.otf', 'Myriad Pro')
('MyriadPro-BoldIt.otf', 'Myriad Pro')
('MyriadPro-Cond.otf', 'Myriad Pro')
('MyriadPro-CondIt.otf', 'Myriad Pro')
('MyriadPro-It.otf', 'Myriad Pro')
('MyriadPro-Regular.otf', 'Myriad Pro')
('MyriadPro-Semibold.otf', 'Myriad Pro')
('MyriadPro-SemiboldIt.otf', 'Myriad Pro')
('NuevaStd-BoldCond.otf', 'Nueva Std')
('NuevaStd-BoldCondItalic.otf', 'Nueva Std')
('NuevaStd-Cond.otf', 'Nueva Std')
('NuevaStd-CondItalic.otf', 'Nueva Std')
('OCRAStd.otf', 'OCR A Std')
('OUTLOOK.TTF', 'MS Outlook')
('OratorStd-Slanted.otf', 'Orator Std')
('OratorStd.otf', 'Orator Std')
('PoplarStd.otf', 'Poplar Std')
('PrestigeEliteStd-Bd.otf', 'Prestige Elite Std')
('REFSAN.TTF', 'MS Reference Sans Serif')
('REFSPCL.TTF', 'MS Reference Specialty')
('RosewoodStd-Regular.otf', 'Rosewood Std')
('SIMLI.TTF', 'LiSu')
('SIMYOU.TTF', 'YouYuan')
('STCAIYUN.TTF', 'STCaiyun')
('STFANGSO.TTF', 'STFangsong')
('STIXGeneral.ttf', 'STIXGeneral')
('STIXGeneralBol.ttf', 'STIXGeneral')
('STIXGeneralBolIta.ttf', 'STIXGeneral')
('STIXGeneralItalic.ttf', 'STIXGeneral')
('STIXNonUni.ttf', 'STIXNonUnicode')
('STIXNonUniBol.ttf', 'STIXNonUnicode')
('STIXNonUniBolIta.ttf', 'STIXNonUnicode')
('STIXNonUniIta.ttf', 'STIXNonUnicode')
('STIXSizFiveSymReg.ttf', 'STIXSizeFiveSym')
('STIXSizFourSymBol.ttf', 'STIXSizeFourSym')
('STIXSizFourSymReg.ttf', 'STIXSizeFourSym')
('STIXSizOneSymBol.ttf', 'STIXSizeOneSym')
('STIXSizOneSymReg.ttf', 'STIXSizeOneSym')
('STIXSizThreeSymBol.ttf', 'STIXSizeThreeSym')
('STIXSizThreeSymReg.ttf', 'STIXSizeThreeSym')
('STIXSizTwoSymBol.ttf', 'STIXSizeTwoSym')
('STIXSizTwoSymReg.ttf', 'STIXSizeTwoSym')
('STXIHEI.TTF', 'STXihei')
('STXINGKA.TTF', 'STXingkai')
('STXINWEI.TTF', 'STXinwei')
('STZHONGS.TTF', 'STZhongsong')
('SURSONG.TTF', 'Simsun (Founder Extended)')
('StencilStd.otf', 'Stencil Std')
('TektonPro-Bold.otf', 'Tekton Pro')
('TektonPro-BoldCond.otf', 'Tekton Pro')
('TektonPro-BoldExt.otf', 'Tekton Pro')
('TektonPro-BoldObl.otf', 'Tekton Pro')
('TrajanPro-Bold.otf', 'Trajan Pro')
('TrajanPro-Regular.otf', 'Trajan Pro')
('Vera.ttf', 'Bitstream Vera Sans')
('VeraBI.ttf', 'Bitstream Vera Sans')
('VeraBd.ttf', 'Bitstream Vera Sans')
('VeraIt.ttf', 'Bitstream Vera Sans')
('VeraMoBI.ttf', 'Bitstream Vera Sans Mono')
('VeraMoBd.ttf', 'Bitstream Vera Sans Mono')
('VeraMoIt.ttf', 'Bitstream Vera Sans Mono')
('VeraMono.ttf', 'Bitstream Vera Sans Mono')
('VeraSe.ttf', 'Bitstream Vera Serif')
('VeraSeBd.ttf', 'Bitstream Vera Serif')
('WINGDNG2.TTF', 'Wingdings 2')
('WINGDNG3.TTF', 'Wingdings 3')
('ZWAdobeF.TTF', 'ZWAdobeF')
('acaslonpro-bold.otf', 'Adobe Caslon Pro')
('acaslonpro-bolditalic.otf', 'Adobe Caslon Pro')
('acaslonpro-italic.otf', 'Adobe Caslon Pro')
('acaslonpro-regular.otf', 'Adobe Caslon Pro')
('acaslonpro-semibold.otf', 'Adobe Caslon Pro')
('acaslonpro-semibolditalic.otf', 'Adobe Caslon Pro')
('adobefangsongstd-regular.otf', 'Adobe Fangsong Std')
('adobeheitistd-regular.otf', 'Adobe Heiti Std')
('adobekaitistd-regular.otf', 'Adobe Kaiti Std')
('adobemingstd-light.otf', 'Adobe Ming Std')
('adobemyungjostd-medium.otf', 'Adobe Myungjo Std')
('adobesongstd-light.otf', 'Adobe Song Std')
('agaramondpro-bold.otf', 'Adobe Garamond Pro')
('agaramondpro-bolditalic.otf', 'Adobe Garamond Pro')
('agaramondpro-italic.otf', 'Adobe Garamond Pro')
('agaramondpro-regular.otf', 'Adobe Garamond Pro')
('antquab.ttf', 'Book Antiqua')
('antquabi.ttf', 'Book Antiqua')
('antquai.ttf', 'Book Antiqua')
('arial.ttf', 'Arial')
('arialbd.ttf', 'Arial')
('arialbi.ttf', 'Arial')
('ariali.ttf', 'Arial')
('arialn.ttf', 'Arial Narrow')
('arialnb.ttf', 'Arial Narrow')
('arialnbi.ttf', 'Arial Narrow')
('arialni.ttf', 'Arial Narrow')
('ariblk.ttf', 'Arial')
('bellgothicstd-black.otf', 'Bell Gothic Std')
('bellgothicstd-bold.otf', 'Bell Gothic Std')
('birchstd.otf', 'Birch Std')
('bkant.ttf', 'Book Antiqua')
('blackoakstd.otf', 'Blackoak Std')
('bookos.ttf', 'Bookman Old Style')
('bookosb.ttf', 'Bookman Old Style')
('bookosbi.ttf', 'Bookman Old Style')
('bookosi.ttf', 'Bookman Old Style')
('brushscriptstd.otf', 'Brush Script Std')
('bssym7.ttf', 'Bookshelf Symbol 7')
('calibri.ttf', 'Calibri')
('calibrib.ttf', 'Calibri')
('calibrii.ttf', 'Calibri')
('calibriz.ttf', 'Calibri')
('cambriab.ttf', 'Cambria')
('cambriai.ttf', 'Cambria')
('cambriaz.ttf', 'Cambria')
('candara.ttf', 'Candara')
('candarab.ttf', 'Candara')
('candarai.ttf', 'Candara')
('candaraz.ttf', 'Candara')
('chaparralpro-bold.otf', 'Chaparral Pro')
('chaparralpro-boldit.otf', 'Chaparral Pro')
('chaparralpro-italic.otf', 'Chaparral Pro')
('chaparralpro-regular.otf', 'Chaparral Pro')
('charlemagnestd-bold.otf', 'Charlemagne Std')
('cmb10.ttf', 'cmb10')
('cmex10.ttf', 'cmex10')
('cmmi10.ttf', 'cmmi10')
('cmr10.ttf', 'cmr10')
('cmss10.ttf', 'cmss10')
('cmsy10.ttf', 'cmsy10')
('cmtt10.ttf', 'cmtt10')
('comic.ttf', 'Comic Sans MS')
('comicbd.ttf', 'Comic Sans MS')
('consola.ttf', 'Consolas')
('consolab.ttf', 'Consolas')
('consolai.ttf', 'Consolas')
('consolaz.ttf', 'Consolas')
('constan.ttf', 'Constantia')
('constanb.ttf', 'Constantia')
('constani.ttf', 'Constantia')
('constanz.ttf', 'Constantia')
('cooperblackstd-italic.otf', 'Cooper Std')
('cooperblackstd.otf', 'Cooper Std')
('corbel.ttf', 'Corbel')
('corbelb.ttf', 'Corbel')
('corbeli.ttf', 'Corbel')
('corbelz.ttf', 'Corbel')
('cour.ttf', 'Courier New')
('courbd.ttf', 'Courier New')
('courbi.ttf', 'Courier New')
('couri.ttf', 'Courier New')
('eccentricstd.otf', 'Eccentric Std')
('envisym_.ttf', 'ENVI Symbols')
('esri_1.ttf', 'ESRI Cartography')
('esri_11.ttf', 'ESRI Default Marker')
('esri_12.ttf', 'ESRI NIMA DNC PT')
('esri_121.ttf', 'ESRI Ordnance Survey')
('esri_13.ttf', 'ESRI NIMA DNC LN')
('esri_130.ttf', 'ESRI SDS 1.95 1')
('esri_131.ttf', 'ESRI SDS 1.95 2')
('esri_132.ttf', 'ESRI SDS 2.00 1')
('esri_133.ttf', 'ESRI SDS 2.00 2')
('esri_14.ttf', 'ESRI NIMA VMAP1&2 PT')
('esri_144.ttf', 'ESRI Arrowhead')
('esri_149.ttf', 'ESRI Surveyor')
('esri_15.ttf', 'ESRI NIMA VMAP1&2 LN')
('esri_150.ttf', 'ESRI AMFM Electric')
('esri_151.ttf', 'ESRI AMFM Gas')
('esri_152.ttf', 'ESRI AMFM Sewer')
('esri_153.ttf', 'ESRI AMFM Water')
('esri_159.ttf', 'ESRI Hydrants')
('esri_16.ttf', 'ESRI NIMA City Graphic PT')
('esri_160.ttf', 'ESRI Telecom')
('esri_161.ttf', 'ESRI Pipeline US 1')
('esri_17.ttf', 'ESRI NIMA City Graphic LN')
('esri_19.ttf', 'ESRI MilMod 02')
('esri_2.ttf', 'ESRI Environmental & Icons')
('esri_20.ttf', 'ESRI MilRed 01')
('esri_21.ttf', 'ESRI MilSym 01')
('esri_216.ttf', 'ESRI IGL Font16')
('esri_22.ttf', 'ESRI MilSym 02')
('esri_220.ttf', 'ESRI IGL Font20')
('esri_221.ttf', 'ESRI IGL Font21')
('esri_222.ttf', 'ESRI IGL Font22')
('esri_223.ttf', 'ESRI IGL Font23')
('esri_224.ttf', 'ESRI IGL Font24')
('esri_225.ttf', 'ESRI IGL Font25')
('esri_23.ttf', 'ESRI MilSym 03')
('esri_24.ttf', 'ESRI MilSym 04')
('esri_25.ttf', 'ESRI MilSym 05')
('esri_26.ttf', 'ESRI MilMod 01')
('esri_29.ttf', 'ESRI Public1')
('esri_3.ttf', 'ESRI Geometric Symbols')
('esri_30s.ttf', 'ESRI ArcPad')
('esri_33.ttf', 'ESRI Climate & Precipitation')
('esri_34.ttf', 'ESRI Business')
('esri_375.ttf', 'ESRI Caves 1')
('esri_376.ttf', 'ESRI Caves 2')
('esri_377.ttf', 'ESRI Caves 3')
('esri_39.ttf', 'ESRI Dimensioning')
('esri_4.ttf', 'ESRI Oil, Gas, & Water')
('esri_40.ttf', 'ESRI North')
('esri_400.ttf', 'ESRI Geology USGS 95-525')
('esri_405.ttf', 'ESRI Elements')
('esri_406.ttf', 'ESRI Commodities')
('esri_44.ttf', 'ESRI Shields')
('esri_47.ttf', 'ESRI US MUTCD 1')
('esri_48.ttf', 'ESRI US MUTCD 2')
('esri_49.ttf', 'ESRI US MUTCD 3')
('esri_5.ttf', 'ESRI Weather')
('esri_500.ttf', 'ESRI Geology AGSO 1')
('esri_651.ttf', 'ESRI US Forestry 1')
('esri_652.ttf', 'ESRI US Forestry 2')
('esri_7.ttf', 'ESRI Geology')
('esri_730.ttf', 'ESRI Conservation')
('esri_8.ttf', 'ESRI Crime Analysis')
('esri_800.ttf', 'ESRI Enviro Hazard Incident')
('esri_801.ttf', 'ESRI Enviro Hazard Analysis')
('esri_802.ttf', 'ESRI Enviro Hazard Sites')
('esri_803.ttf', 'ESRI Hazardous Materials')
('esri_804.ttf', 'ESRI Fire Incident NFPA')
('esri_832.ttf', 'ESRI ERS Infrastructures S1')
('esri_837.ttf', 'ESRI ERS Operations S1')
('esri_9.ttf', 'ESRI Transportation & Civic')
('estre.ttf', 'Estrangelo Edessa')
('euclid.ttf', 'Euclid')
('euclidb.ttf', 'Euclid')
('euclidbi.ttf', 'Euclid')
('euclidi.ttf', 'Euclid')
('eucsym.ttf', 'Euclid Symbol')
('eucsymb.ttf', 'Euclid Symbol')
('eucsymbi.ttf', 'Euclid Symbol')
('eucsymi.ttf', 'Euclid Symbol')
('euextra.ttf', 'Euclid Extra')
('euextrab.ttf', 'Euclid Extra')
('eufrak.ttf', 'Euclid Fraktur')
('eufrakb.ttf', 'Euclid Fraktur')
('eumat1.ttf', 'Euclid Math One')
('eumat1b.ttf', 'Euclid Math One')
('eumat2.ttf', 'Euclid Math Two')
('eumat2b.ttf', 'Euclid Math Two')
('eurosign.ttf', 'Euro Sign')
('fences.ttf', 'Fences')
('framd.ttf', 'Franklin Gothic Medium')
('framdit.ttf', 'Franklin Gothic Medium')
('fzstk.ttf', 'FZShuTi')
('fzytk.ttf', 'FZYaoTi')
('gara.ttf', 'Garamond')
('garabd.ttf', 'Garamond')
('garait.ttf', 'Garamond')
('gautami.ttf', 'Gautami')
('georgia.ttf', 'Georgia')
('georgiab.ttf', 'Georgia')
('georgiai.ttf', 'Georgia')
('georgiaz.ttf', 'Georgia')
('giddyupstd.otf', 'Giddyup Std')
('gothic.ttf', 'Century Gothic')
('gothicb.ttf', 'Century Gothic')
('gothicbi.ttf', 'Century Gothic')
('gothici.ttf', 'Century Gothic')
('gsdefsym.ttf', 'GSI Default Symbols')
('gsdidger1.ttf', 'GSI Didger')
('gsgeol1.ttf', 'GSI Geologic Symbols')
('gsmap1.ttf', 'GSI Map Symbols')
('gsnarrow.ttf', 'GSI North Arrows')
('gsoandg1.ttf', 'GSI Oil and Gas')
('gswbarb1.ttf', 'GSI Wind Barb Symbols')
('gsweath1.ttf', 'GSI Weather Symbols')
('hobostd.otf', 'Hobo Std')
('impact.ttf', 'Impact')
('kartika.ttf', 'Kartika')
('kozgopro-bold.otf', 'Kozuka Gothic Pro')
('kozgopro-extralight.otf', 'Kozuka Gothic Pro')
('kozgopro-heavy.otf', 'Kozuka Gothic Pro')
('kozgopro-light.otf', 'Kozuka Gothic Pro')
('kozgopro-medium.otf', 'Kozuka Gothic Pro')
('kozgopro-regular.otf', 'Kozuka Gothic Pro')
('kozminpro-bold.otf', 'Kozuka Mincho Pro')
('kozminpro-extralight.otf', 'Kozuka Mincho Pro')
('kozminpro-heavy.otf', 'Kozuka Mincho Pro')
('kozminpro-light.otf', 'Kozuka Mincho Pro')
('kozminpro-medium.otf', 'Kozuka Mincho Pro')
('kozminpro-regular.otf', 'Kozuka Mincho Pro')
('l_10646.ttf', 'Lucida Sans Unicode')
('latha.ttf', 'Latha')
('lettergothicstd-bold.otf', 'Letter Gothic Std')
('lettergothicstd-boldslanted.otf', 'Letter Gothic Std')
('lettergothicstd-slanted.otf', 'Letter Gothic Std')
('lettergothicstd.otf', 'Letter Gothic Std')
('lithospro-black.otf', 'Lithos Pro')
('lithospro-regular.otf', 'Lithos Pro')
('lsans.ttf', 'Lucida Sans')
('lsansd.ttf', 'Lucida Sans')
('lsansdi.ttf', 'Lucida Sans')
('lsansi.ttf', 'Lucida Sans')
('lucidabrightdemibold.ttf', 'Lucida Bright')
('lucidabrightdemiitalic.ttf', 'Lucida Bright')
('lucidabrightitalic.ttf', 'Lucida Bright')
('lucidabrightregular.ttf', 'Lucida Bright')
('lucidasansdemibold.ttf', 'Lucida Sans')
('lucidasansregular.ttf', 'Lucida Sans')
('lucidatypewriterbold.ttf', 'Lucida Sans Typewriter')
('lucidatypewriterregular.ttf', 'Lucida Sans Typewriter')
('lucon.ttf', 'Lucida Console')
('mangal.ttf', 'Mangal')
('marlett.ttf', 'Marlett')
('mesquitestd.otf', 'Mesquite Std')
('micross.ttf', 'Microsoft Sans Serif')
('minionpro-bold.otf', 'Minion Pro')
('minionpro-boldcn.otf', 'Minion Pro')
('minionpro-boldcnit.otf', 'Minion Pro')
('minionpro-boldit.otf', 'Minion Pro')
('minionpro-it.otf', 'Minion Pro')
('minionpro-medium.otf', 'Minion Pro')
('minionpro-mediumit.otf', 'Minion Pro')
('minionpro-regular.otf', 'Minion Pro')
('minionpro-semibold.otf', 'Minion Pro')
('minionpro-semiboldit.otf', 'Minion Pro')
('msyh.ttf', 'Microsoft YaHei')
('msyhbd.ttf', 'Microsoft YaHei')
('mtcorsva.ttf', 'Monotype Corsiva')
('mtextra.ttf', 'MT Extra')
('mvboli.ttf', 'MV Boli')
('myriadpro-bold.otf', 'Myriad Pro')
('myriadpro-boldcond.otf', 'Myriad Pro')
('myriadpro-boldcondit.otf', 'Myriad Pro')
('myriadpro-boldit.otf', 'Myriad Pro')
('myriadpro-cond.otf', 'Myriad Pro')
('myriadpro-condit.otf', 'Myriad Pro')
('myriadpro-it.otf', 'Myriad Pro')
('myriadpro-regular.otf', 'Myriad Pro')
('myriadpro-semibold.otf', 'Myriad Pro')
('myriadpro-semiboldit.otf', 'Myriad Pro')
('nuevastd-boldcond.otf', 'Nueva Std')
('nuevastd-boldconditalic.otf', 'Nueva Std')
('nuevastd-cond.otf', 'Nueva Std')
('nuevastd-conditalic.otf', 'Nueva Std')
('ocrastd.otf', 'OCR A Std')
('oratorstd-slanted.otf', 'Orator Std')
('oratorstd.otf', 'Orator Std')
('outlook.ttf', 'MS Outlook')
('pala.ttf', 'Palatino Linotype')
('palab.ttf', 'Palatino Linotype')
('palabi.ttf', 'Palatino Linotype')
('palai.ttf', 'Palatino Linotype')
('poplarstd.otf', 'Poplar Std')
('prestigeelitestd-bd.otf', 'Prestige Elite Std')
('raavi.ttf', 'Raavi')
('refsan.ttf', 'MS Reference Sans Serif')
('refspcl.ttf', 'MS Reference Specialty')
('rosewoodstd-regular.otf', 'Rosewood Std')
('segoeui.ttf', 'Segoe UI')
('shruti.ttf', 'Shruti')
('simfang.ttf', 'FangSong_GB2312')
('simhei.ttf', 'SimHei')
('simkai.ttf', 'KaiTi_GB2312')
('simli.ttf', 'LiSu')
('simyou.ttf', 'YouYuan')
('stcaiyun.ttf', 'STCaiyun')
('stencilstd.otf', 'Stencil Std')
('stfangso.ttf', 'STFangsong')
('stxihei.ttf', 'STXihei')
('stxingka.ttf', 'STXingkai')
('stxinwei.ttf', 'STXinwei')
('stzhongs.ttf', 'STZhongsong')
('sursong.ttf', 'Simsun (Founder Extended)')
('sylfaen.ttf', 'Sylfaen')
('symbol.ttf', 'Symbol')
('tahoma.ttf', 'Tahoma')
('tahomabd.ttf', 'Tahoma')
('tektonpro-bold.otf', 'Tekton Pro')
('tektonpro-boldcond.otf', 'Tekton Pro')
('tektonpro-boldext.otf', 'Tekton Pro')
('tektonpro-boldobl.otf', 'Tekton Pro')
('times.ttf', 'Times New Roman')
('timesbd.ttf', 'Times New Roman')
('timesbi.ttf', 'Times New Roman')
('timesi.ttf', 'Times New Roman')
('trajanpro-bold.otf', 'Trajan Pro')
('trajanpro-regular.otf', 'Trajan Pro')
('trebuc.ttf', 'Trebuchet MS')
('trebucbd.ttf', 'Trebuchet MS')
('trebucbi.ttf', 'Trebuchet MS')
('trebucit.ttf', 'Trebuchet MS')
('tt0003m_.ttf', 'Swis721 BT')
('tt0004m_.ttf', 'Swis721 BT')
('tt0005m_.ttf', 'Swis721 BT')
('tt0006m_.ttf', 'Swis721 BT')
('tt0011m_.ttf', 'Dutch801 Rm BT')
('tt0012m_.ttf', 'Dutch801 Rm BT')
('tt0013m_.ttf', 'Dutch801 Rm BT')
('tt0014m_.ttf', 'Dutch801 Rm BT')
('tt0419m_.ttf', 'Courier10 BT')
('tt0582m_.ttf', 'Courier10 BT')
('tt0583m_.ttf', 'Courier10 BT')
('tt0611m_.ttf', 'Courier10 BT')
('tt9830z_.ttf', 'SymbolProp BT')
('tt9831z_.ttf', 'SymbolMono BT')
('tunga.ttf', 'Tunga')
('verdana.ttf', 'Verdana')
('verdanab.ttf', 'Verdana')
('verdanai.ttf', 'Verdana')
('verdanaz.ttf', 'Verdana')
('vrinda.ttf', 'Vrinda')
('webdings.ttf', 'Webdings')
('wingding.ttf', 'Wingdings')
('wingdng2.ttf', 'Wingdings 2')
('wingdng3.ttf', 'Wingdings 3')
('zwadobef.ttf', 'ZWAdobeF')

所有字体

2011年02月16日 星期三 08:31

这些字体是在C:\WINDOWS\Fonts

还是在C:\Python26\Lib\site-packages\matplotlib\mpl-data\fonts\ttf 下

2011年02月16日 星期三 10:49

前面的程序我特意将路径去掉了,如果你要看路径,可以:

fonts = [(font.fname, font.name) for font in fontManager.ttflist]

另外不需要将字体复制到fonts\ttf下,matplotlib会从windows\fonts下找字体的。

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号