java 获取当前系统可用字体名称

//获取系统的字体
    public static void getLocalFontFamily(){
        GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
        String [] fontName=ge.getAvailableFontFamilyNames();
        
        for(int i=0;i<fontName.length;i++){
            System.out.println(fontName[i]);
        }
    }

调用得:

AcadEref
Adobe Devanagari
Agency FB
AIGDT
AjiwaiPro
Algerian
AmdtSymbols
AMGDT
Arial
Arial Black
Arial Narrow
Arial Rounded MT Bold
Arvo
Bahnschrift
BankGothic Lt BT
BankGothic Md BT
Baskerville Old Face
Bauhaus 93
Bell MT
Berlin Sans FB
Berlin Sans FB Demi
Bernard MT Condensed
Blackadder ITC
Bodoni MT
Bodoni MT Black
Bodoni MT Condensed
Bodoni MT Poster Compressed
Book Antiqua
Bookman Old Style
Bookshelf Symbol 7
Bradley Hand ITC
Britannic Bold
Broadway
Brush Script MT
Calibri
Calibri Light
Californian FB
Calisto MT
Cambria
Cambria Math
Candara
Castellar
Centaur
Century
Century Gothic
Century Schoolbook
Chiller
CityBlueprint
Colonna MT
Comic Sans MS
CommercialPi BT
CommercialScript BT
Complex
Consolas
Constantia
Cooper Black
Copperplate Gothic Bold
Copperplate Gothic Light
Corbel
CountryBlueprint
Courier New
Curlz MT
DejaVu Sans Mono
DengXian
DengXian Light
Dialog
DialogInput
Droid Serif
Dubai
Dubai Light
Dubai Medium
Dutch801 Rm BT
Dutch801 XBd BT
Ebrima
Edwardian Script ITC
Elephant
Engravers MT
Eras Bold ITC
Eras Demi ITC
Eras Light ITC
Eras Medium ITC
EuroRoman
FangSong
Felix Titling
Footlight MT Light
Forte
Franklin Gothic Book
Franklin Gothic Demi
Franklin Gothic Demi Cond
Franklin Gothic Heavy
Franklin Gothic Medium
Franklin Gothic Medium Cond
Freestyle Script
French Script MT
FZShuTi
FZXiHei I-Z08T
FZYaoTi
Gabriola
Gadugi
Garamond
GDT
GENISO
Georgia
Gigi
Gill Sans MT
Gill Sans MT Condensed
Gill Sans MT Ext Condensed Bold
Gill Sans Ultra Bold
Gill Sans Ultra Bold Condensed
Gloucester MT Extra Condensed
GothicE
GothicG
GothicI
Goudy Old Style
Goudy Stout
GreekC
GreekS
Haettenschweiler
Harlow Solid Italic
Harrington
High Tower Text
HoloLens MDL2 Assets
HYCaoLiF
HYChuKaiF
HYCuSongJ
HYHengFangBeiF
HYLiuKaiF
HYLuXingF
HYOuXingF
HYTangLiF
HYWangXingF
HYZhaoKaiF
HYZhiCaoF
HYZhiKaiF
Impact
Imprint MT Shadow
Indie Flower
Informal Roman
Ink Free
ISOCP
ISOCP2
ISOCP3
ISOCPEUR
ISOCT
ISOCT2
ISOCT3
ISOCTEUR
Italic
ItalicC
ItalicT
Javanese Text
Jokerman
Juice ITC
KaiTi
Kristen ITC
Kunstler Script
Leelawadee UI
Leelawadee UI Semilight
LiSu
Lobster
Lucida Bright
Lucida Calligraphy
Lucida Console
Lucida Fax
Lucida Handwriting
Lucida Sans
Lucida Sans Typewriter
Lucida Sans Unicode
Magneto
Maiandra GD
Malgun Gothic
Malgun Gothic Semilight
Marlett
Matura MT Script Capitals
Microsoft Himalaya
Microsoft JhengHei
Microsoft JhengHei Light
Microsoft JhengHei UI
Microsoft JhengHei UI Light
Microsoft New Tai Lue
Microsoft PhagsPa
Microsoft Sans Serif
Microsoft Tai Le
Microsoft YaHei
Microsoft YaHei Light
Microsoft YaHei UI
Microsoft YaHei UI Light
Microsoft Yi Baiti
MingLiU-ExtB
MingLiU_HKSCS-ExtB
Mistral
Modern No. 20
Mongolian Baiti
Monospac821 BT
Monospaced
Monotxt
Monotype Corsiva
MS Gothic
MS Outlook
MS PGothic
MS Reference Sans Serif
MS Reference Specialty
MS UI Gothic
MT Extra
MV Boli
Myanmar Text
Niagara Engraved
Niagara Solid
Nirmala UI
Nirmala UI Semilight
NSimSun
OCR A Extended
Old English Text MT
Onyx
Open Sans
Palace Script MT
Palatino Linotype
PanRoman
Papyrus
Parchment
Perpetua
Perpetua Titling MT
Playbill
PMingLiU-ExtB
Poiret One
Poor Richard
Pristina
Proxy 1
Proxy 2
Proxy 3
Proxy 4
Proxy 5
Proxy 6
Proxy 7
Proxy 8
Proxy 9
Rage Italic
Raleway
Ravie
Roboto
Roboto Condensed
Roboto Slab
Rockwell
Rockwell Condensed
Rockwell Extra Bold
RomanC
RomanD
RomanS
RomanT
Romantic
SansSerif
Script MT Bold
ScriptC
ScriptS
Segoe MDL2 Assets
Segoe Print
Segoe Script
Segoe UI
Segoe UI Black
Segoe UI Emoji
Segoe UI Historic
Segoe UI Light
Segoe UI Semibold
Segoe UI Semilight
Segoe UI Symbol
Serif
Showcard Gothic
SimHei
Simplex
SimSun
SimSun-ExtB
Sitka Banner
Sitka Display
Sitka Heading
Sitka Small
Sitka Subheading
Sitka Text
Snap ITC
Source Code Pro
Source Code Pro Black
Source Code Pro ExtraLight
Source Code Pro Light
Source Code Pro Semibold
STCaiyun
Stencil
STFangsong
STHupo
STKaiti
STLiti
STSong
STXihei
STXingkai
STXinwei
Stylus BT
STZhongsong
SuperFrench
Swis721 BdCnOul BT
Swis721 BdOul BT
Swis721 Blk BT
Swis721 BlkCn BT
Swis721 BlkEx BT
Swis721 BlkOul BT
Swis721 BT
Swis721 Cn BT
Swis721 Ex BT
Swis721 Lt BT
Swis721 LtCn BT
Swis721 LtEx BT
Syastro
Sylfaen
Symap
Symath
Symbol
Symeteo
Symusic
Tahoma
Technic
TechnicBold
TechnicLite
Tempus Sans ITC
Times New Roman
Trebuchet MS
Tw Cen MT
Tw Cen MT Condensed
Tw Cen MT Condensed Extra Bold
Txt
UniversalMath1 BT
Verdana
Viner Hand ITC
Vineta BT
Vivaldi
Vladimir Script
Webdings
Wide Latin
Wingdings
Wingdings 2
Wingdings 3
YouYuan
Yu Gothic
Yu Gothic Light
Yu Gothic Medium
Yu Gothic UI
Yu Gothic UI Light
Yu Gothic UI Semibold
Yu Gothic UI Semilight
ZHSRXT-GBK
ZWAdobeF
汉仪粗宋简
经典粗宋简
经典粗宋繁

猜你喜欢

转载自www.cnblogs.com/feiquan/p/9136788.html