| 1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
| 2 | .\" |
| 3 | .\" Standard preamble: |
| 4 | .\" ======================================================================== |
| 5 | .de Sh \" Subsection heading |
| 6 | .br |
| 7 | .if t .Sp |
| 8 | .ne 5 |
| 9 | .PP |
| 10 | \fB\\$1\fR |
| 11 | .PP |
| 12 | .. |
| 13 | .de Sp \" Vertical space (when we can't use .PP) |
| 14 | .if t .sp .5v |
| 15 | .if n .sp |
| 16 | .. |
| 17 | .de Vb \" Begin verbatim text |
| 18 | .ft CW |
| 19 | .nf |
| 20 | .ne \\$1 |
| 21 | .. |
| 22 | .de Ve \" End verbatim text |
| 23 | .ft R |
| 24 | .fi |
| 25 | .. |
| 26 | .\" Set up some character translations and predefined strings. \*(-- will |
| 27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
| 28 | .\" double quote, and \*(R" will give a right double quote. | will give a |
| 29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
| 30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
| 31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. |
| 32 | .tr \(*W-|\(bv\*(Tr |
| 33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
| 34 | .ie n \{\ |
| 35 | . ds -- \(*W- |
| 36 | . ds PI pi |
| 37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
| 38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
| 39 | . ds L" "" |
| 40 | . ds R" "" |
| 41 | . ds C` "" |
| 42 | . ds C' "" |
| 43 | 'br\} |
| 44 | .el\{\ |
| 45 | . ds -- \|\(em\| |
| 46 | . ds PI \(*p |
| 47 | . ds L" `` |
| 48 | . ds R" '' |
| 49 | 'br\} |
| 50 | .\" |
| 51 | .\" If the F register is turned on, we'll generate index entries on stderr for |
| 52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
| 53 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
| 54 | .\" output yourself in some meaningful fashion. |
| 55 | .if \nF \{\ |
| 56 | . de IX |
| 57 | . tm Index:\\$1\t\\n%\t"\\$2" |
| 58 | .. |
| 59 | . nr % 0 |
| 60 | . rr F |
| 61 | .\} |
| 62 | .\" |
| 63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 64 | .\" way too many mistakes in technical documents. |
| 65 | .hy 0 |
| 66 | .if n .na |
| 67 | .\" |
| 68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
| 69 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
| 70 | . \" fudge factors for nroff and troff |
| 71 | .if n \{\ |
| 72 | . ds #H 0 |
| 73 | . ds #V .8m |
| 74 | . ds #F .3m |
| 75 | . ds #[ \f1 |
| 76 | . ds #] \fP |
| 77 | .\} |
| 78 | .if t \{\ |
| 79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
| 80 | . ds #V .6m |
| 81 | . ds #F 0 |
| 82 | . ds #[ \& |
| 83 | . ds #] \& |
| 84 | .\} |
| 85 | . \" simple accents for nroff and troff |
| 86 | .if n \{\ |
| 87 | . ds ' \& |
| 88 | . ds ` \& |
| 89 | . ds ^ \& |
| 90 | . ds , \& |
| 91 | . ds ~ ~ |
| 92 | . ds / |
| 93 | .\} |
| 94 | .if t \{\ |
| 95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
| 96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
| 97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
| 98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
| 99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
| 100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
| 101 | .\} |
| 102 | . \" troff and (daisy-wheel) nroff accents |
| 103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
| 104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
| 105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
| 106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
| 107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
| 108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
| 109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
| 110 | .ds ae a\h'-(\w'a'u*4/10)'e |
| 111 | .ds Ae A\h'-(\w'A'u*4/10)'E |
| 112 | . \" corrections for vroff |
| 113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
| 114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
| 115 | . \" for low resolution devices (crt and lpr) |
| 116 | .if \n(.H>23 .if \n(.V>19 \ |
| 117 | \{\ |
| 118 | . ds : e |
| 119 | . ds 8 ss |
| 120 | . ds o a |
| 121 | . ds d- d\h'-1'\(ga |
| 122 | . ds D- D\h'-1'\(hy |
| 123 | . ds th \o'bp' |
| 124 | . ds Th \o'LP' |
| 125 | . ds ae ae |
| 126 | . ds Ae AE |
| 127 | .\} |
| 128 | .rm #[ #] #H #V #F C |
| 129 | .\" ======================================================================== |
| 130 | .\" |
| 131 | .IX Title "FONT 1" |
| 132 | .TH FONT 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation" |
| 133 | .SH "NAME" |
| 134 | font \- Create and inspect fonts. |
| 135 | .SH "SYNOPSIS" |
| 136 | .IX Header "SYNOPSIS" |
| 137 | \&\ \fI$widget\fR\->\fBFont\fR(\fIoption\fR?, \fIarg, arg, ...\fR?) |
| 138 | .PP |
| 139 | \&\ \fI$font\fR\->\fIOption\fR?(\fIarg, arg, ...\fR)? |
| 140 | .SH "DESCRIPTION" |
| 141 | .IX Header "DESCRIPTION" |
| 142 | The \fBFont\fR method provides several facilities for dealing with |
| 143 | fonts, such as defining named fonts and inspecting the actual attributes of |
| 144 | a font. The command has several different forms, determined by the |
| 145 | first argument. The following forms are currently supported: |
| 146 | .IP "\fI$font\fR\->\fBactual\fR(\fI\-option\fR?)" 4 |
| 147 | .IX Item "$font->actual(-option?)" |
| 148 | .PD 0 |
| 149 | .IP "\fI$widget\fR\->\fBfontActual\fR(\fIfont\fR?, \fI\-option\fR?)" 4 |
| 150 | .IX Item "$widget->fontActual(font?, -option?)" |
| 151 | .PD |
| 152 | Returns information about the actual attributes that are obtained when |
| 153 | \&\fIfont\fR is used on \fI$font\fR's display; the actual attributes obtained |
| 154 | may differ from the attributes requested due to platform-dependant |
| 155 | limitations, such as the availability of font families and pointsizes. |
| 156 | \&\fIfont\fR is a font description; see \*(L"\s-1FONT\s0 \s-1DESCRIPTION\s0\*(R" below. If |
| 157 | \&\fIoption\fR is specified, returns the value of that attribute; if it is |
| 158 | omitted, the return value is a list of all the attributes and their values. |
| 159 | See \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below for a list of the possible attributes. |
| 160 | .IP "\fI$font\fR\->\fBconfigure\fR(\fI\-option\fR??=>\fIvalue\fR, \fI\-option\fR=>\fIvalue\fR, ...?)" 4 |
| 161 | .IX Item "$font->configure(-option??=>value, -option=>value, ...?)" |
| 162 | Query or modify the desired attributes for \fI$font\fR. |
| 163 | If no \fI\-option\fR is specified, returns a list describing |
| 164 | all the options and their values for \fIfontname\fR. If a single \fI\-option\fR |
| 165 | is specified with no \fIvalue\fR, then returns the current value of that |
| 166 | attribute. If one or more \fIoption-value\fR pairs are specified, |
| 167 | then the method modifies the given named font to have the given values; in |
| 168 | this case, all widgets using that font will redisplay themselves using the |
| 169 | new attributes for the font. See \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below for a list of the |
| 170 | possible attributes. |
| 171 | .Sp |
| 172 | Note: the above behaviour differs in detail to \fBconfigure\fR on widgets, |
| 173 | images etc. |
| 174 | .IP "\fI$font\fR = \fI$widget\fR\->\fBFont\fR(\fI\-option\fR=>\fIvalue\fR, ...>?)" 4 |
| 175 | .IX Item "$font = $widget->Font(-option=>value, ...>?)" |
| 176 | .PD 0 |
| 177 | .IP "\fI$font\fR = \fI$widget\fR\->\fBfontCreate\fR(?\fIfontname\fR??, \fI\-option\fR=>\fIvalue\fR, ...>?)" 4 |
| 178 | .IX Item "$font = $widget->fontCreate(?fontname??, -option=>value, ...>?)" |
| 179 | .PD |
| 180 | Creates a new font object and returns a reference to it. |
| 181 | \&\fIfontname\fR specifies the name for the font; if it is omitted, then Tk generates |
| 182 | a new name of the form \fBfont\fR\fIx\fR, where \fIx\fR is an integer. There may be any |
| 183 | number of \fIoption-value\fR pairs, which provide the desired attributes for |
| 184 | the new named font. See \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below for a list of the possible |
| 185 | attributes. |
| 186 | .Sp |
| 187 | Note: the created font is \fInot\fR shared between widgets of different |
| 188 | MainWindows. |
| 189 | .IP "\fI$font\fR\->\fBdelete\fR" 4 |
| 190 | .IX Item "$font->delete" |
| 191 | .PD 0 |
| 192 | .IP "\fI$widget\fR\->\fBfontDelete\fR(\fIfontname\fR?, \fIfontname\fR, ...?)" 4 |
| 193 | .IX Item "$widget->fontDelete(fontname?, fontname, ...?)" |
| 194 | .PD |
| 195 | Delete the specified named fonts. If there are widgets using the named font, |
| 196 | the named font won't actually be deleted until all the instances are |
| 197 | released. Those widgets will continue to display using the last known values |
| 198 | for the named font. If a deleted named font is subsequently recreated with |
| 199 | another call to \fBfontCreate\fR, the widgets will use the new named font |
| 200 | and redisplay themselves using the new attributes of that font. |
| 201 | .IP "\fI$widget\fR\->\fBfontFamilies\fR" 4 |
| 202 | .IX Item "$widget->fontFamilies" |
| 203 | The return value is a list of the case-insensitive names of all font families |
| 204 | that exist on \fI$widget\fR's display. |
| 205 | .IP "\fI$font\fR\->\fBmeasure\fR(\fItext\fR)" 4 |
| 206 | .IX Item "$font->measure(text)" |
| 207 | .PD 0 |
| 208 | .IP "\fI$widget\fR\->\fBfontMeasure\fR(\fIfont\fR, \fItext\fR)" 4 |
| 209 | .IX Item "$widget->fontMeasure(font, text)" |
| 210 | .PD |
| 211 | Measures the amount of space the string \fItext\fR would use in the given |
| 212 | \&\fIfont\fR when displayed in \fI$widget\fR. \fIfont\fR is a font description; |
| 213 | see \*(L"\s-1FONT\s0 \s-1DESCRIPTION\s0\*(R" below. |
| 214 | The return value is the total width in pixels |
| 215 | of \fItext\fR, not including the extra pixels used by highly exagerrated |
| 216 | characters such as cursive ``\fIf\fR''. If the string contains newlines or tabs, |
| 217 | those characters are not expanded or treated specially when measuring the |
| 218 | string. |
| 219 | .IP "\fI$font\fR\->\fBmetrics\fR(\fI\-option\fR?)" 4 |
| 220 | .IX Item "$font->metrics(-option?)" |
| 221 | .PD 0 |
| 222 | .IP "\fI$widget\fR\->\fBfontMetrics\fR(\fIfont\fR?, \fI\-option\fR?)" 4 |
| 223 | .IX Item "$widget->fontMetrics(font?, -option?)" |
| 224 | .PD |
| 225 | Returns information about the metrics (the font-specific data), for |
| 226 | \&\fIfont\fR when it is used on \fI$widget\fR's display. \fIfont\fR is a font |
| 227 | description; see \*(L"\s-1FONT\s0 \s-1DESCRIPTION\s0\*(R" below. |
| 228 | If \fIoption\fR is specified, |
| 229 | returns the value of that metric; if it is omitted, the return value is a |
| 230 | list of all the metrics and their values. See \*(L"\s-1FONT\s0 \s-1METRICS\s0\*(R" below for a list |
| 231 | of the possible metrics. |
| 232 | .IP "\fI$widget\fR\->\fBfontNames\fR" 4 |
| 233 | .IX Item "$widget->fontNames" |
| 234 | The return value is a list of all font objects that are currently defined for |
| 235 | \&\fI$widget\fR's MainWindow. |
| 236 | .SH "FONT DESCRIPTION" |
| 237 | .IX Header "FONT DESCRIPTION" |
| 238 | The following formats are accepted as a font description anywhere |
| 239 | \&\fIfont\fR is specified as an argument above; these same forms are also |
| 240 | permitted when specifying the \fB\-font\fR option for widgets. |
| 241 | .IP "[1] \fIfontname\fR" 4 |
| 242 | .IX Item "[1] fontname" |
| 243 | The name of a named font, created using the \fBfontCreate\fR method. When |
| 244 | a widget uses a named font, it is guaranteed that this will never cause an |
| 245 | error, as long as the named font exists, no matter what potentially invalid |
| 246 | or meaningless set of attributes the named font has. If the named font |
| 247 | cannot be displayed with exactly the specified attributes, some other close |
| 248 | font will be substituted automatically. |
| 249 | .IP "[1a] \fI$font\fR" 4 |
| 250 | .IX Item "[1a] $font" |
| 251 | A font object created using the \fBFont\fR method. This is essentially the same |
| 252 | as using a named font. The object is a reference to the name, and carries |
| 253 | additional information e.g. which MainWindow it relates to in an manner peculiar |
| 254 | to perl/Tk. |
| 255 | .IP "[3] \fIsystemfont\fR" 4 |
| 256 | .IX Item "[3] systemfont" |
| 257 | The platform-specific name of a font, interpreted by the graphics server. |
| 258 | This also includes, under X, an \s-1XLFD\s0 (see [4]) for which a single ``\fB*\fR'' |
| 259 | character was used to elide more than one field in the middle of the |
| 260 | name. See \*(L"\s-1PLATFORM\-SPECIFIC\s0 \s-1ISSUES\s0\*(R" for a list of the system fonts. |
| 261 | .IP "[3] [\fIfamily\fR,?\fIsize\fR,??\fIstyle\fR,??\fIstyle ...\fR?]" 4 |
| 262 | .IX Item "[3] [family,?size,??style,??style ...?]" |
| 263 | A properly formed list whose first element is the desired font |
| 264 | \&\fIfamily\fR and whose optional second element is the desired \fIsize\fR. |
| 265 | The interpretation of the \fIsize\fR attribute follows the same rules |
| 266 | described for \-size in \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below. Any additional optional |
| 267 | arguments following the \fIsize\fR are font \fIstyle\fRs. Possible values |
| 268 | for the \fIstyle\fR arguments are as follows: |
| 269 | .Sp |
| 270 | .Vb 2 |
| 271 | \& normal bold roman italic |
| 272 | \& underline overstrike |
| 273 | .Ve |
| 274 | .IP "[4] X\-font names (\s-1XLFD\s0)" 4 |
| 275 | .IX Item "[4] X-font names (XLFD)" |
| 276 | A Unix-centric font name of the form |
| 277 | \&\fI\-foundry\-family\-weight\-slant\-setwidth\-addstyle\-pixel\-point\-resx\-resy\-spacing\-width\-charset\-encoding\fR. |
| 278 | The ``\fB*\fR'' character may be used to skip individual fields that the |
| 279 | user does not care about. There must be exactly one ``\fB*\fR'' for each |
| 280 | field skipped, except that a ``\fB*\fR'' at the end of the \s-1XLFD\s0 skips any |
| 281 | remaining fields; the shortest valid \s-1XLFD\s0 is simply ``\fB*\fR'', signifying |
| 282 | all fields as defaults. Any fields that were skipped are given default |
| 283 | values. For compatibility, an \s-1XLFD\s0 always chooses a font of the specified |
| 284 | pixel size (not point size); although this interpretation is not strictly |
| 285 | correct, all existing applications using XLFDs assumed that one ``point'' |
| 286 | was in fact one pixel and would display incorrectly (generally larger) if |
| 287 | the correct size font were actually used. |
| 288 | .IP "[5] \fIoption value \fR?\fIoption value ...\fR?" 4 |
| 289 | .IX Item "[5] option value ?option value ...?" |
| 290 | A properly formed list of \fIoption-value\fR pairs that specify |
| 291 | the desired attributes of the font, in the same format used when defining |
| 292 | a named font; see \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below. |
| 293 | .PP |
| 294 | When font description \fIfont\fR is used, the system attempts to parse the |
| 295 | description according to each of the above five rules, in the order specified. |
| 296 | Cases [1] and [2] must match the name of an existing named font or of a |
| 297 | system font. Cases [3], [4], and [5] are accepted on all |
| 298 | platforms and the closest available font will be used. In some situations |
| 299 | it may not be possible to find any close font (e.g., the font family was |
| 300 | a garbage value); in that case, some system-dependant default font is |
| 301 | chosen. If the font description does not match any of the above patterns, |
| 302 | an error is generated. |
| 303 | .SH "FONT METRICS" |
| 304 | .IX Header "FONT METRICS" |
| 305 | The following options are used by the \fBmetrics\fR/\fBfontMetrics\fR method to query |
| 306 | font-specific data determined when the font was created. These properties are |
| 307 | for the whole font itself and not for individual characters drawn in that |
| 308 | font. In the following definitions, the ``baseline'' of a font is the |
| 309 | horizontal line where the bottom of most letters line up; certain letters, |
| 310 | such as lower-case ``g'' stick below the baseline. |
| 311 | .IP "\fB\-ascent\fR" 4 |
| 312 | .IX Item "-ascent" |
| 313 | The amount in pixels that the tallest letter sticks up above the baseline of |
| 314 | the font, plus any extra blank space added by the designer of the font. |
| 315 | (\fI$font\fR\-<gt>\fBascent\fR is provided for compatibility.) |
| 316 | .IP "\fB\-descent\fR" 4 |
| 317 | .IX Item "-descent" |
| 318 | The largest amount in pixels that any letter sticks down below the baseline |
| 319 | of the font, plus any extra blank space added by the designer of the font. |
| 320 | (\fI$font\fR\-<gt>\fBdescent\fR is provided for compatibility.) |
| 321 | .IP "\fB\-linespace\fR" 4 |
| 322 | .IX Item "-linespace" |
| 323 | Returns how far apart vertically in pixels two lines of text using the same |
| 324 | font should be placed so that none of the characters in one line overlap any |
| 325 | of the characters in the other line. This is generally the sum of the ascent |
| 326 | above the baseline line plus the descent below the baseline. |
| 327 | .IP "\fB\-fixed\fR" 4 |
| 328 | .IX Item "-fixed" |
| 329 | Returns a boolean flag that is ``\fB1\fR'' if this is a fixed-width font, |
| 330 | where each normal character is the the same width as all the other |
| 331 | characters, or is ``\fB0\fR'' if this is a proportionally-spaced font, where |
| 332 | individual characters have different widths. The widths of control |
| 333 | characters, tab characters, and other non-printing characters are not |
| 334 | included when calculating this value. |
| 335 | .SH "FONT OPTIONS" |
| 336 | .IX Header "FONT OPTIONS" |
| 337 | The following options are supported on all platforms, and are used when |
| 338 | constructing a named font or when specifying a font using style [5] as |
| 339 | above: |
| 340 | .IP "\fB\-family\fR => \fIname\fR" 4 |
| 341 | .IX Item "-family => name" |
| 342 | The case-insensitive font family name. Tk guarantees to support the font |
| 343 | families named \fBCourier\fR (a monospaced ``typewriter'' font), \fBTimes\fR |
| 344 | (a serifed ``newspaper'' font), and \fBHelvetica\fR (a sans-serif |
| 345 | ``European'' font). The most closely matching native font family will |
| 346 | automatically be substituted when one of the above font families is used. |
| 347 | The \fIname\fR may also be the name of a native, platform-specific font |
| 348 | family; in that case it will work as desired on one platform but may not |
| 349 | display correctly on other platforms. If the family is unspecified or |
| 350 | unrecognized, a platform-specific default font will be chosen. |
| 351 | .IP "\fB\-size\fR => \fIsize\fR" 4 |
| 352 | .IX Item "-size => size" |
| 353 | The desired size of the font. If the \fIsize\fR argument is a positive |
| 354 | number, it is interpreted as a size in points. If \fIsize\fR is a negative |
| 355 | number, its absolute value is interpreted as a size in pixels. If a |
| 356 | font cannot be displayed at the specified size, a nearby size will be |
| 357 | chosen. If \fIsize\fR is unspecified or zero, a platform-dependent default |
| 358 | size will be chosen. |
| 359 | .Sp |
| 360 | The original Tcl/Tk authors believe sizes should normally be specified in points |
| 361 | so the application will remain the same ruler size on the screen, even when |
| 362 | changing screen resolutions or moving scripts across platforms. While this is an |
| 363 | admirable goal it does not work as well in practice as they hoped. |
| 364 | The mapping between points and pixels is set when the application starts, based |
| 365 | on alleged properties of the installed monitor, but it can be overridden by |
| 366 | calling the scaling command. However this can be |
| 367 | problematic when system has no way of telling if (say) an 11\*(L" or 22\*(R" monitor is |
| 368 | attached, also if it \fIcan\fR tell then some monitor sizes may result in poorer |
| 369 | quality scaled fonts being used rather than a \*(L"tuned\*(R" bitmap font. |
| 370 | In addition specifying pixels is useful in certain circumstances such as when a piece of text |
| 371 | must line up with respect to a fixed-size bitmap. |
| 372 | .Sp |
| 373 | At present the Tcl/Tk scheme is used unchanged, with \*(L"point\*(R" size being returned |
| 374 | by \fIactual\fR (as an integer), and used internally. Suggestions for work-rounds |
| 375 | to undesirable behaviour welcome. |
| 376 | .IP "\fB\-weight\fR => \fIweight\fR" 4 |
| 377 | .IX Item "-weight => weight" |
| 378 | The nominal thickness of the characters in the font. The value |
| 379 | \&\fBnormal\fR specifies a normal weight font, while \fBbold\fR specifies a |
| 380 | bold font. The closest available weight to the one specified will |
| 381 | be chosen. The default weight is \fBnormal\fR. |
| 382 | .IP "\fB\-slant\fR => \fIslant\fR" 4 |
| 383 | .IX Item "-slant => slant" |
| 384 | The amount the characters in the font are slanted away from the |
| 385 | vertical. Valid values for slant are \fBroman\fR and \fBitalic\fR. |
| 386 | A roman font is the normal, upright appearance of a font, while |
| 387 | an italic font is one that is tilted some number of degrees from upright. |
| 388 | The closest available slant to the one specified will be chosen. |
| 389 | The default slant is \fBroman\fR. |
| 390 | .IP "\fB\-underline\fR => \fIboolean\fR" 4 |
| 391 | .IX Item "-underline => boolean" |
| 392 | The value is a boolean flag that specifies whether characters in this |
| 393 | font should be underlined. The default value for underline is \fBfalse\fR. |
| 394 | .IP "\fB\-overstrike\fR => \fIboolean\fR" 4 |
| 395 | .IX Item "-overstrike => boolean" |
| 396 | The value is a boolean flag that specifies whether a horizontal line should |
| 397 | be drawn through the middle of characters in this font. The default value |
| 398 | for overstrike is \fBfalse\fR. |
| 399 | .SH "PLATFORM-SPECIFIC ISSUES" |
| 400 | .IX Header "PLATFORM-SPECIFIC ISSUES" |
| 401 | The following named system fonts are supported: |
| 402 | .IP "X Windows:" 4 |
| 403 | .IX Item "X Windows:" |
| 404 | All valid X font names, including those listed by \fIxlsfonts\fR\|(1), are available. |
| 405 | .IP "\s-1MS\s0 Windows:" 4 |
| 406 | .IX Item "MS Windows:" |
| 407 | .Vb 2 |
| 408 | \& system ansi device |
| 409 | \& systemfixed ansifixed oemfixed |
| 410 | .Ve |
| 411 | .IP "Macintosh:" 4 |
| 412 | .IX Item "Macintosh:" |
| 413 | .Vb 1 |
| 414 | \& system application |
| 415 | .Ve |
| 416 | .SH "COMPATIBILITY WITH PREVIOUS VERSIONS" |
| 417 | .IX Header "COMPATIBILITY WITH PREVIOUS VERSIONS" |
| 418 | In prior versions of perl/Tk the \fI$widget\fR\->\fBFont\fR method was a perl |
| 419 | wrapper on the original \*(L"[4] X\-font names (\s-1XLFD\s0)\*(R" style as described above |
| 420 | (which was the only form supported by versions of core tk prior to version |
| 421 | tk8.0). |
| 422 | This module is provided in its original form (it has just been renamed) |
| 423 | via: |
| 424 | .PP |
| 425 | .Vb 2 |
| 426 | \& use Tk::X11Font; |
| 427 | \& I<$widget>-E<gt>B<X11Font>(...) |
| 428 | .Ve |
| 429 | .PP |
| 430 | However the methods of the old scheme have been mimiced as closely as possible |
| 431 | with the new scheme. It is intended that code should work without modification, |
| 432 | except for the case of using : |
| 433 | .PP |
| 434 | .Vb 1 |
| 435 | \& @names = $font->Name; |
| 436 | .Ve |
| 437 | .PP |
| 438 | i.e. the \fIName\fR method in an array/list context. This now returns one element |
| 439 | on all platforms (as it did on Win32), while previously on X systems it returned |
| 440 | a list of fonts that matched an under-specified pattern. |
| 441 | .PP |
| 442 | Briefly the methods supported for compatibilty are as follows: |
| 443 | .IP "$newfont = \fI$font\fR\->\fBClone\fR(\fI\-option\fR=>\fIvalue\fR, ...>?)" 4 |
| 444 | .IX Item "$newfont = $font->Clone(-option=>value, ...>?)" |
| 445 | Returns a new font object \fI$newfont\fR related to the original \fI$font\fR by |
| 446 | changing the values of the specified \fI\-option\fRs. |
| 447 | .IP "\fI$font\fR\->Family \- maps to \-family" 4 |
| 448 | .IX Item "$font->Family - maps to -family" |
| 449 | .PD 0 |
| 450 | .IP "\fI$font\fR\->Weight \- maps to \-weight" 4 |
| 451 | .IX Item "$font->Weight - maps to -weight" |
| 452 | .IP "\fI$font\fR\->Slant \- maps to \-slant" 4 |
| 453 | .IX Item "$font->Slant - maps to -slant" |
| 454 | .IP "\fI$font\fR\->Pixel and Point \- map to \-size" 4 |
| 455 | .IX Item "$font->Pixel and Point - map to -size" |
| 456 | .PD |
| 457 | .PP |
| 458 | New code should use \fI$font\fR\->\fBconfigure\fR to achieve same effect as last |
| 459 | four items above. |
| 460 | .IP "Foundry, Swidth, Adstyle, Xres, Yres, Space, Avgwidth, Registry, Encoding" 4 |
| 461 | .IX Item "Foundry, Swidth, Adstyle, Xres, Yres, Space, Avgwidth, Registry, Encoding" |
| 462 | Are all ignored if set, and return '*' if queried. |
| 463 | .IP "\fI$font\fR\->\fBName\fR" 4 |
| 464 | .IX Item "$font->Name" |
| 465 | Returns the name of a named font, or a string representation of an unnamed |
| 466 | font. Using \fI$font\fR in a scalar context does the same. Note this is distinctly |
| 467 | different from behaviour of X11Font's Name in |
| 468 | a list context. |
| 469 | .IP "\fI$font\fR\->\fBPattern\fR" 4 |
| 470 | .IX Item "$font->Pattern" |
| 471 | Returns a \s-1XLFD\s0 string for the font based on \fIactual\fR values, and some heuristics |
| 472 | to map Tk's forms to the \*(L"standard\*(R" X conventions. |
| 473 | .SH "SEE ALSO" |
| 474 | .IX Header "SEE ALSO" |
| 475 | Tk::options |
| 476 | .PP |
| 477 | Tk::X11Font |
| 478 | .SH "KEYWORDS" |
| 479 | .IX Header "KEYWORDS" |
| 480 | font |