- Tcl教程
- Tcl - 首页
- Tcl - 概述
- Tcl - 环境设置
- Tcl - 特殊变量
- Tcl - 基本语法
- Tcl - 命令
- Tcl - 数据类型
- Tcl - 变量
- Tcl - 运营商
- Tcl - 决策
- Tcl - 循环
- Tcl - 数组
- Tcl - 字符串
- Tcl - 列表
- Tcl - 字典
- Tcl - 程序
- Tcl - 套餐
- Tcl - 命名空间
- Tcl - 文件 I/O
- Tcl - 错误处理
- Tcl - 内置函数
- Tcl - 正则表达式
- TK 教程
- Tk - 概述
- Tk-环境
- Tk - 特殊变量
- Tk - 小部件概述
- Tk - 基本小部件
- Tk - 布局小部件
- Tk - 选择小部件
- Tk - 画布小部件
- Tk - 大型小部件
- Tk-字体
- Tk - 图像
- Tk - 活动
- Tk-Windows 管理器
- Tk - 几何管理器
- Tcl/Tk 有用资源
- Tcl/Tk - 快速指南
- Tcl/Tk - 有用的资源
- Tcl/Tk - 讨论
Tk-字体
有许多小部件支持显示文本。其中大多数都提供字体属性的选项。创建字体的语法如下所示 -
font create fontName options
选项
下表列出了可用于字体创建的选项 -
先生。 | 语法和描述 |
---|---|
1 | - 家庭姓氏 字体系列的名称。 |
2 | -尺寸号码 字体大小。 |
3 | -体重水平 字体的粗细。 |
下面显示了一个简单的字体创建示例 -
#!/usr/bin/wish font create myFont -family Helvetica -size 18 -weight bold pack [label .myLabel -font myFont -text "Hello World"]
当我们运行上面的程序时,我们将得到以下输出 -
要获取所有可用的字体,我们可以使用以下命令 -
#!/usr/bin/wish puts [font families]
当我们运行上面的命令时,我们将得到以下输出 -
{Abadi MT Condensed Extra Bold} {Abadi MT Condensed Light} {Al Bayan} {Al Nile} {Al Tarikh} {American Typewriter} {Andale Mono} Arial {Arial Black} {Arial Hebrew} {Arial Narrow} {Arial Rounded MT Bold} {Arial Unicode MS} Athelas Avenir {Avenir Next} {Avenir Next Condensed} Ayuthaya Baghdad {Bangla MN} {Bangla Sangam MN} {Baoli SC} Baskerville {Baskerville Old Face} Batang {Bauhaus 93} Beirut {Bell MT} {Bernard MT Condensed} BiauKai {Big Caslon} {Book Antiqua} {Bookman Old Style} {Bookshelf Symbol 7} Braggadocio {Britannic Bold} {Brush Script MT} Calibri {Calisto MT} Cambria {Cambria Math} Candara Century {Century Gothic} {Century Schoolbook} Chalkboard {Chalkboard SE} Chalkduster {Charcoal CY} Charter Cochin {Colonna MT} {Comic Sans MS} Consolas Constantia {Cooper Black} Copperplate {Copperplate Gothic Bold} {Copperplate Gothic Light} Corbel {Corsiva Hebrew} Courier {Courier New} {Curlz MT} Damascus {DecoType Naskh} Desdemona {Devanagari MT} {Devanagari Sangam MN} Didot {DIN Alternate} {DIN Condensed} {Diwan Kufi} {Diwan Thuluth} {Edwardian Script ITC} {Engravers MT} {Euphemia UCAS} Eurostile Farah Farisi {Footlight MT Light} {Franklin Gothic Book} {Franklin Gothic Medium} Futura Gabriola Garamond {GB18030 Bitmap} {Geeza Pro} Geneva {Geneva CY} Georgia {Gill Sans} {Gill Sans MT} {Gloucester MT Extra Condensed} {Goudy Old Style} {Gujarati MT} {Gujarati Sangam MN} Gulim GungSeo {Gurmukhi MN} {Gurmukhi MT} {Gurmukhi Sangam MN} Haettenschweiler {Hannotate SC} {Hannotate TC} {HanziPen SC} {HanziPen TC} Harrington HeadLineA Hei {Heiti SC} {Heiti TC} Helvetica {Helvetica CY} {Helvetica Neue} Herculanum {Hiragino Kaku Gothic Pro} {Hiragino Kaku Gothic ProN} {Hiragino Kaku Gothic Std} {Hiragino Kaku Gothic StdN} {Hiragino Maru Gothic Pro} {Hiragino Maru Gothic ProN} {Hiragino Mincho Pro} {Hiragino Mincho ProN} {Hiragino Sans GB} {Hoefler Text} Impact {Imprint MT Shadow} InaiMathi {Iowan Old Style} Kai Kailasa {Kaiti SC} {Kaiti TC} {Kannada MN} {Kannada Sangam MN} Kefa {Khmer MN} {Khmer Sangam MN} {Kino MT} Kokonor Krungthep KufiStandardGK {Lantinghei SC} {Lantinghei TC} {Lao MN} {Lao Sangam MN} {Libian SC} {LiHei Pro} {LiSong Pro} {Lucida Blackletter} {Lucida Bright} {Lucida Calligraphy} {Lucida Console} {Lucida Fax} {Lucida Grande} {Lucida Handwriting} {Lucida Sans} {Lucida Sans Typewriter} {Lucida Sans Unicode} {Malayalam MN} {Malayalam Sangam MN} Marion {Marker Felt} Marlett {Matura MT Script Capitals} Meiryo Menlo {Microsoft Sans Serif} Mishafi Mistral {Modern No. 20} Monaco {MS Gothic} {MS Mincho} {MS PGothic} {MS PMincho} {MS Reference Sans Serif} {MS Reference Specialty} Mshtakan {MT Extra} Muna {Myanmar MN} {Myanmar Sangam MN} Nadeem {Nanum Brush Script} {Nanum Gothic} {Nanum Myeongjo} {Nanum Pen Script} {New Peninim MT} {News Gothic MT} Noteworthy Onyx Optima {Oriya MN} {Oriya Sangam MN} Osaka Palatino {Palatino Linotype} Papyrus PCMyungjo Perpetua {Perpetua Titling MT} PilGi {Plantagenet Cherokee} Playbill PMingLiU {PT Mono} {PT Sans} {PT Sans Caption} {PT Sans Narrow} {PT Serif} {PT Serif Caption} Raanana Rockwell {Rockwell Extra Bold} Sana Sathu {Savoye LET} Seravek Silom SimSun {Sinhala MN} {Sinhala Sangam MN} Skia {Snell Roundhand} {Songti SC} {Songti TC} Stencil STFangsong STHeiti STIXGeneral STIXIntegralsD STIXIntegralsSm STIXIntegralsUp STIXIntegralsUpD STIXIntegralsUpSm STIXNonUnicode STIXSizeFiveSym STIXSizeFourSym STIXSizeOneSym STIXSizeThreeSym STIXSizeTwoSym STIXVariants STKaiti STSong Superclarendon Symbol Tahoma {Tamil MN} {Tamil Sangam MN} TeamViewer8 {Telugu MN} {Telugu Sangam MN} Thonburi Times {Times New Roman} {Trebuchet MS} {Tw Cen MT} Verdana Waseem {Wawati SC} {Wawati TC} Webdings {Weibei SC} {Weibei TC} {Wide Latin} Wingdings {Wingdings 2} {Wingdings 3} {Xingkai SC} {Yuanti SC} YuGothic YuMincho {Yuppy SC} {Yuppy TC} {Zapf Dingbats} Zapfino {Apple Braille} {Apple Chancery} {Apple Color Emoji} {Apple LiGothic} {Apple LiSung} {Apple SD Gothic Neo} {Apple Symbols} AppleGothic AppleMyungjo {Monotype Corsiva} {Monotype Sorts}