1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QFont Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QFont Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QFont class specifies a font used for drawing text. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qfont.html#Capitalization-enum">Capitalization</a></b> { MixedCase, AllUppercase, AllLowercase, SmallCaps, Capitalize }</li><li><div class="fn" />enum <b><a href="qfont.html#HintingPreference-enum">HintingPreference</a></b> { PreferDefaultHinting, PreferNoHinting, PreferVerticalHinting, PreferFullHinting }</li><li><div class="fn" />enum <b><a href="qfont.html#SpacingType-enum">SpacingType</a></b> { PercentageSpacing, AbsoluteSpacing }</li><li><div class="fn" />enum <b><a href="qfont.html#Stretch-enum">Stretch</a></b> { UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, ..., UltraExpanded }</li><li><div class="fn" />enum <b><a href="qfont.html#Style-enum">Style</a></b> { StyleNormal, StyleItalic, StyleOblique }</li><li><div class="fn" />enum <b><a href="qfont.html#StyleHint-enum">StyleHint</a></b> { Helvetica, SansSerif, Times, Serif, ..., Fantasy }</li><li><div class="fn" />enum <b><a href="qfont.html#StyleStrategy-enum">StyleStrategy</a></b> { PreferDefault, PreferBitmap, PreferDevice, PreferOutline, ..., ForceIntegerMetrics }</li><li><div class="fn" />enum <b><a href="qfont.html#Weight-enum">Weight</a></b> { Light, Normal, DemiBold, Bold, Black }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qfont.html#QFont">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qfont.html#QFont-2">__init__</a></b> (<i>self</i>, QString <i>family</i>, int <i>pointSize</i> = -1, int <i>weight</i> = -1, bool <i>italic</i> = False)</li><li><div class="fn" /><b><a href="qfont.html#QFont-3">__init__</a></b> (<i>self</i>, QFont, QPaintDevice <i>pd</i>)</li><li><div class="fn" /><b><a href="qfont.html#QFont-4">__init__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" /><b><a href="qfont.html#QFont-5">__init__</a></b> (<i>self</i>, QVariant <i>variant</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#bold">bold</a></b> (<i>self</i>)</li><li><div class="fn" />Capitalization <b><a href="qfont.html#capitalization">capitalization</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#defaultFamily">defaultFamily</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#exactMatch">exactMatch</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#family">family</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#fixedPitch">fixedPitch</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#fromString">fromString</a></b> (<i>self</i>, QString)</li><li><div class="fn" />int <b><a href="qfont.html#handle">handle</a></b> (<i>self</i>)</li><li><div class="fn" />HintingPreference <b><a href="qfont.html#hintingPreference">hintingPreference</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#isCopyOf">isCopyOf</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />bool <b><a href="qfont.html#italic">italic</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#kerning">kerning</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#key">key</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#lastResortFamily">lastResortFamily</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#lastResortFont">lastResortFont</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qfont.html#letterSpacing">letterSpacing</a></b> (<i>self</i>)</li><li><div class="fn" />SpacingType <b><a href="qfont.html#letterSpacingType">letterSpacingType</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#overline">overline</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qfont.html#pixelSize">pixelSize</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qfont.html#pointSize">pointSize</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qfont.html#pointSizeF">pointSizeF</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#rawMode">rawMode</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#rawName">rawName</a></b> (<i>self</i>)</li><li><div class="fn" />QFont <b><a href="qfont.html#resolve">resolve</a></b> (<i>self</i>, QFont)</li><li><div class="fn" /><b><a href="qfont.html#setBold">setBold</a></b> (<i>self</i>, bool <i>enable</i>)</li><li><div class="fn" /><b><a href="qfont.html#setCapitalization">setCapitalization</a></b> (<i>self</i>, Capitalization)</li><li><div class="fn" /><b><a href="qfont.html#setFamily">setFamily</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qfont.html#setFixedPitch">setFixedPitch</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setHintingPreference">setHintingPreference</a></b> (<i>self</i>, HintingPreference <i>hintingPreference</i>)</li><li><div class="fn" /><b><a href="qfont.html#setItalic">setItalic</a></b> (<i>self</i>, bool <i>b</i>)</li><li><div class="fn" /><b><a href="qfont.html#setKerning">setKerning</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setLetterSpacing">setLetterSpacing</a></b> (<i>self</i>, SpacingType <i>type</i>, float <i>spacing</i>)</li><li><div class="fn" /><b><a href="qfont.html#setOverline">setOverline</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setPixelSize">setPixelSize</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qfont.html#setPointSize">setPointSize</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qfont.html#setPointSizeF">setPointSizeF</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qfont.html#setRawMode">setRawMode</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setRawName">setRawName</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qfont.html#setStretch">setStretch</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qfont.html#setStrikeOut">setStrikeOut</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setStyle">setStyle</a></b> (<i>self</i>, Style <i>style</i>)</li><li><div class="fn" /><b><a href="qfont.html#setStyleHint">setStyleHint</a></b> (<i>self</i>, StyleHint <i>hint</i>, StyleStrategy <i>strategy</i> = QFont.PreferDefault)</li><li><div class="fn" /><b><a href="qfont.html#setStyleName">setStyleName</a></b> (<i>self</i>, QString <i>styleName</i>)</li><li><div class="fn" /><b><a href="qfont.html#setStyleStrategy">setStyleStrategy</a></b> (<i>self</i>, StyleStrategy <i>s</i>)</li><li><div class="fn" /><b><a href="qfont.html#setUnderline">setUnderline</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setWeight">setWeight</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qfont.html#setWordSpacing">setWordSpacing</a></b> (<i>self</i>, float <i>spacing</i>)</li><li><div class="fn" />int <b><a href="qfont.html#stretch">stretch</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#strikeOut">strikeOut</a></b> (<i>self</i>)</li><li><div class="fn" />Style <b><a href="qfont.html#style">style</a></b> (<i>self</i>)</li><li><div class="fn" />StyleHint <b><a href="qfont.html#styleHint">styleHint</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#styleName">styleName</a></b> (<i>self</i>)</li><li><div class="fn" />StyleStrategy <b><a href="qfont.html#styleStrategy">styleStrategy</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#toString">toString</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#underline">underline</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qfont.html#weight">weight</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qfont.html#wordSpacing">wordSpacing</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" /><b><a href="qfont.html#cacheStatistics">cacheStatistics</a></b> ()</li><li><div class="fn" /><b><a href="qfont.html#cleanup">cleanup</a></b> ()</li><li><div class="fn" /><b><a href="qfont.html#initialize">initialize</a></b> ()</li><li><div class="fn" /><b><a href="qfont.html#insertSubstitution">insertSubstitution</a></b> (QString, QString)</li><li><div class="fn" /><b><a href="qfont.html#insertSubstitutions">insertSubstitutions</a></b> (QString, QStringList)</li><li><div class="fn" /><b><a href="qfont.html#removeSubstitution">removeSubstitution</a></b> (QString)</li><li><div class="fn" />QString <b><a href="qfont.html#substitute">substitute</a></b> (QString)</li><li><div class="fn" />QStringList <b><a href="qfont.html#substitutes">substitutes</a></b> (QString)</li><li><div class="fn" />QStringList <b><a href="qfont.html#substitutions">substitutions</a></b> ()</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qfont.html#__eq__">__eq__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />bool <b><a href="qfont.html#__ge__">__ge__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />bool <b><a href="qfont.html#__lt__">__lt__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />bool <b><a href="qfont.html#__ne__">__ne__</a></b> (<i>self</i>, QFont)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QFont class specifies a font used for drawing text.</p>
<p>When you create a QFont object you specify various attributes
that you want the font to have. Qt will use the font with the
specified attributes, or if no matching font exists, Qt will use
the closest matching installed font. The attributes of the font
that is actually used are retrievable from a <a href="qfontinfo.html">QFontInfo</a> object. If the window system
provides an exact match <a href="qfont.html#exactMatch">exactMatch</a>() returns true. Use <a href="qfontmetrics.html">QFontMetrics</a> to get measurements, e.g. the
pixel length of a string using <a href="qfontmetrics.html#width">QFontMetrics.width</a>().</p>
<p>Note that a <a href="qapplication.html">QApplication</a>
instance must exist before a QFont can be used. You can set the
application's default font with <a href="qapplication.html#setFont">QApplication.setFont</a>().</p>
<p>If a chosen font does not include all the characters that need
to be displayed, QFont will try to find the characters in the
nearest equivalent fonts. When a <a href="qpainter.html">QPainter</a> draws a character from a font the
QFont will report whether or not it has the character; if it does
not, <a href="qpainter.html">QPainter</a> will draw an unfilled
square.</p>
<p>Create QFonts like this:</p>
<pre class="cpp">
<span class="type">QFont</span> serifFont(<span class="string">"Times"</span><span class="operator">,</span> <span class="number">10</span><span class="operator">,</span> <span class="type">QFont</span><span class="operator">.</span>Bold);
<span class="type">QFont</span> sansFont(<span class="string">"Helvetica [Cronyx]"</span><span class="operator">,</span> <span class="number">12</span>);
</pre>
<p>The attributes set in the constructor can also be set later,
e.g. <a href="qfont.html#setFamily">setFamily</a>(), <a href="qfont.html#setPointSize">setPointSize</a>(), <a class="compat" href="qfont-qt3.html#setPointSizeFloat">setPointSizeFloat</a>(), <a href="qfont.html#setWeight">setWeight</a>() and <a href="qfont.html#setItalic">setItalic</a>(). The remaining attributes
must be set after contstruction, e.g. <a href="qfont.html#setBold">setBold</a>(), <a href="qfont.html#setUnderline">setUnderline</a>(), <a href="qfont.html#setOverline">setOverline</a>(), <a href="qfont.html#setStrikeOut">setStrikeOut</a>() and <a href="qfont.html#setFixedPitch">setFixedPitch</a>(). <a href="qfontinfo.html">QFontInfo</a> objects should be created
<i>after</i> the font's attributes have been set. A <a href="qfontinfo.html">QFontInfo</a> object will not change, even if you
change the font's attributes. The corresponding "get" functions,
e.g. <a href="qfont.html#family">family</a>(), <a href="qfont.html#pointSize">pointSize</a>(), etc., return the values
that were set, even though the values used may differ. The actual
values are available from a <a href="qfontinfo.html">QFontInfo</a>
object.</p>
<p>If the requested font family is unavailable you can influence
the <a href="#fontmatching">font matching algorithm</a> by choosing
a particular <a href="qfont.html#StyleHint-enum">QFont.StyleHint</a> and <a href="qfont.html#StyleStrategy-enum">QFont.StyleStrategy</a> with
<a href="qfont.html#setStyleHint">setStyleHint</a>(). The default
family (corresponding to the current style hint) is returned by
<a href="qfont.html#defaultFamily">defaultFamily</a>().</p>
<p>The font-matching algorithm has a <a href="qfont.html#lastResortFamily">lastResortFamily</a>() and <a href="qfont.html#lastResortFont">lastResortFont</a>() in cases where a
suitable match cannot be found. You can provide substitutions for
font family names using <a href="qfont.html#insertSubstitution">insertSubstitution</a>() and
<a href="qfont.html#insertSubstitutions">insertSubstitutions</a>().
Substitutions can be removed with <a href="qfont.html#removeSubstitution">removeSubstitution</a>(). Use
<a href="qfont.html#substitute">substitute</a>() to retrieve a
family's first substitute, or the family name itself if it has no
substitutes. Use <a href="qfont.html#substitutes">substitutes</a>()
to retrieve a list of a family's substitutes (which may be
empty).</p>
<p>Every QFont has a <a href="qfont.html#key">key</a>() which you
can use, for example, as the key in a cache or dictionary. If you
want to store a user's font preferences you could use <a href="qsettings.html">QSettings</a>, writing the font information with
<a href="qfont.html#toString">toString</a>() and reading it back
with <a href="qfont.html#fromString">fromString</a>(). The
operator<<() and operator>>() functions are also
available, but they work on a data stream.</p>
<p>It is possible to set the height of characters shown on the
screen to a specified number of pixels with <a href="qfont.html#setPixelSize">setPixelSize</a>(); however using
<a href="qfont.html#setPointSize">setPointSize</a>() has a similar
effect and provides device independence.</p>
<p>In X11 you can set a font using its system specific name with
<a href="qfont.html#setRawName">setRawName</a>().</p>
<p>Loading fonts can be expensive, especially on X11. QFont
contains extensive optimizations to make the copying of QFont
objects fast, and to cache the results of the slow window system
functions it depends upon.</p>
<a id="fontmatching" name="fontmatching" />
<p>The font matching algorithm works as follows:</p>
<ol class="1">
<li>The specified font family is searched for.</li>
<li>If not found, the <a href="qfont.html#styleHint">styleHint</a>() is used to select a
replacement family.</li>
<li>Each replacement font family is searched for.</li>
<li>If none of these are found or there was no <a href="qfont.html#styleHint">styleHint</a>(), "helvetica" will be
searched for.</li>
<li>If "helvetica" isn't found Qt will try the <a href="qfont.html#lastResortFamily">lastResortFamily</a>().</li>
<li>If the <a href="qfont.html#lastResortFamily">lastResortFamily</a>() isn't found Qt
will try the <a href="qfont.html#lastResortFont">lastResortFont</a>() which will always
return a name of some kind.</li>
</ol>
<p>Note that the actual font matching algorithm varies from
platform to platform.</p>
<p>In Windows a request for the "Courier" font is automatically
changed to "Courier New", an improved version of Courier that
allows for smooth scaling. The older "Courier" bitmap font can be
selected by setting the <a href="qfont.html#StyleStrategy-enum">PreferBitmap</a> style strategy
(see <a href="qfont.html#setStyleStrategy">setStyleStrategy</a>()).</p>
<p>Once a font is found, the remaining attributes are matched in
order of priority:</p>
<ol class="1">
<li><a href="qfont.html#fixedPitch">fixedPitch</a>()</li>
<li><a href="qfont.html#pointSize">pointSize</a>() (see below)</li>
<li><a href="qfont.html#weight">weight</a>()</li>
<li><a href="qfont.html#style">style</a>()</li>
</ol>
<p>If you have a font which matches on family, even if none of the
other attributes match, this font will be chosen in preference to a
font which doesn't match on family but which does match on the
other attributes. This is because font family is the dominant
search criteria.</p>
<p>The point size is defined to match if it is within 20% of the
requested point size. When several fonts match and are only
distinguished by point size, the font with the closest point size
to the one requested will be chosen.</p>
<p>The actual family, font size, weight and other font attributes
used for drawing text will depend on what's available for the
chosen family under the window system. A <a href="qfontinfo.html">QFontInfo</a> object can be used to determine the
actual values used for drawing the text.</p>
<p>Examples:</p>
<pre class="cpp">
<span class="type">QFont</span> f(<span class="string">"Helvetica"</span>);
</pre>
<p>If you had both an Adobe and a Cronyx Helvetica, you might get
either.</p>
<pre class="cpp">
<span class="type">QFont</span> f(<span class="string">"Helvetica [Cronyx]"</span>);
</pre>
<p>You can specify the foundry you want in the family name. The
font f in the above example will be set to "Helvetica
[Cronyx]".</p>
<p>To determine the attributes of the font actually used in the
window system, use a <a href="qfontinfo.html">QFontInfo</a> object,
e.g.</p>
<pre class="cpp">
<span class="type"><a href="qfontinfo.html">QFontInfo</a></span> info(f1);
<span class="type"><a href="qstring.html">QString</a></span> family <span class="operator">=</span> info<span class="operator">.</span><a href="qfont.html#family">family</a>();
</pre>
<p>To find out font metrics use a <a href="qfontmetrics.html">QFontMetrics</a> object, e.g.</p>
<pre class="cpp">
<span class="type"><a href="qfontmetrics.html">QFontMetrics</a></span> fm(f1);
<span class="type">int</span> textWidthInPixels <span class="operator">=</span> fm<span class="operator">.</span>width(<span class="string">"How many pixels wide is this text?"</span>);
<span class="type">int</span> textHeightInPixels <span class="operator">=</span> fm<span class="operator">.</span>height();
</pre>
<p>For more general information on fonts, see the <a href="http://nwalsh.com/comp.fonts/FAQ/">comp.fonts FAQ.</a> Information
on encodings can be found from <a href="http://czyborra.com/">Roman
Czyborra's</a> page.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Capitalization-enum" />QFont.Capitalization</h3><p>Rendering option for text this font applies to.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFont.MixedCase</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">This is the normal text rendering option where
no capitalization change is applied.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.AllUppercase</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">This alters the text to be rendered in all
uppercase type.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.AllLowercase</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">This alters the text to be rendered in all
lowercase type.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.SmallCaps</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">This alters the text to be rendered in
small-caps type.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Capitalize</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">This alters the text to be rendered with the
first character of each word as an uppercase character.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.4.</p>
<h3 class="fn"><a name="HintingPreference-enum" />QFont.HintingPreference</h3><p>This enum describes the different levels of hinting that can be
applied to glyphs to improve legibility on displays where it might
be warranted by the density of pixels.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferDefaultHinting</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Use the default hinting level for the target
platform.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferNoHinting</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">If possible, render text without hinting the
outlines of the glyphs. The text layout will be typographically
accurate and scalable, using the same metrics as are used e.g. when
printing.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferVerticalHinting</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">If possible, render text with no horizontal
hinting, but align glyphs to the pixel grid in the vertical
direction. The text will appear crisper on displays where the
density is too low to give an accurate rendering of the glyphs. But
since the horizontal metrics of the glyphs are unhinted, the text's
layout will be scalable to higher density devices (such as
printers) without impacting details such as line breaks.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferFullHinting</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">If possible, render text with hinting in both
horizontal and vertical directions. The text will be altered to
optimize legibility on the target device, but since the metrics
will depend on the target size of the text, the positions of
glyphs, line breaks, and other typographical detail will not scale,
meaning that a text layout may look different on devices with
different pixel densities.</td>
</tr>
</table>
<p>Please note that this enum only describes a preference, as the
full range of hinting levels are not supported on all of Qt's
supported platforms. The following table details the effect of a
given hinting preference on a selected set of target platforms.</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th />
<th>PreferDefaultHinting</th>
<th>PreferNoHinting</th>
<th>PreferVerticalHinting</th>
<th>PreferFullHinting</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>Windows Vista (w/o Platform Update) and earlier</td>
<td>Full hinting</td>
<td>Full hinting</td>
<td>Full hinting</td>
<td>Full hinting</td>
</tr>
<tr class="even" valign="top">
<td>Windows 7 and Windows Vista (w/Platform Update) and DirectWrite
enabled in Qt</td>
<td>Full hinting</td>
<td>Vertical hinting</td>
<td>Vertical hinting</td>
<td>Full hinting</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qt-embedded-fonts.html#freetype">FreeType</a></td>
<td>Operating System setting</td>
<td>No hinting</td>
<td>Vertical hinting (light)</td>
<td>Full hinting</td>
</tr>
<tr class="even" valign="top">
<td>Cocoa on Mac OS X</td>
<td>No hinting</td>
<td>No hinting</td>
<td>No hinting</td>
<td>No hinting</td>
</tr>
</table>
<p><b>Note:</b> Please be aware that altering the hinting
preference on Windows is available through the DirectWrite font
engine. This is available on Windows Vista after installing the
platform update, and on Windows 7. In order to use this extension,
configure Qt using -directwrite. The target application will then
depend on the availability of DirectWrite on the target system.</p>
<p>This enum was introduced or modified in Qt 4.8.</p>
<h3 class="fn"><a name="SpacingType-enum" />QFont.SpacingType</h3><table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PercentageSpacing</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">A value of 100 will keep the spacing
unchanged; a value of 200 will enlarge the spacing after a
character by the width of the character itself.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.AbsoluteSpacing</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">A positive value increases the letter spacing
by the corresponding pixels; a negative value decreases the
spacing.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.4.</p>
<h3 class="fn"><a name="Stretch-enum" />QFont.Stretch</h3><p>Predefined stretch values that follow the CSS naming convention.
The higher the value, the more stretched the text is.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFont.UltraCondensed</tt></td>
<td class="topAlign"><tt>50</tt></td>
<td class="topAlign">50</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.ExtraCondensed</tt></td>
<td class="topAlign"><tt>62</tt></td>
<td class="topAlign">62</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Condensed</tt></td>
<td class="topAlign"><tt>75</tt></td>
<td class="topAlign">75</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.SemiCondensed</tt></td>
<td class="topAlign"><tt>87</tt></td>
<td class="topAlign">87</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Unstretched</tt></td>
<td class="topAlign"><tt>100</tt></td>
<td class="topAlign">100</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.SemiExpanded</tt></td>
<td class="topAlign"><tt>112</tt></td>
<td class="topAlign">112</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Expanded</tt></td>
<td class="topAlign"><tt>125</tt></td>
<td class="topAlign">125</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.ExtraExpanded</tt></td>
<td class="topAlign"><tt>150</tt></td>
<td class="topAlign">150</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.UltraExpanded</tt></td>
<td class="topAlign"><tt>200</tt></td>
<td class="topAlign">200</td>
</tr>
</table>
<p><b>See also</b> <a href="qfont.html#setStretch">setStretch</a>()
and <a href="qfont.html#stretch">stretch</a>().</p>
<h3 class="fn"><a name="Style-enum" />QFont.Style</h3><p>This enum describes the different styles of glyphs that are used
to display text.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFont.StyleNormal</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Normal glyphs used in unstyled text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.StyleItalic</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Italic glyphs that are specifically designed
for the purpose of representing italicized text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.StyleOblique</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Glyphs with an italic appearance that are
typically based on the unstyled glyphs, but are not fine-tuned for
the purpose of representing italicized text.</td>
</tr>
</table>
<p><b>See also</b> <a href="qfont.html#Weight-enum">Weight</a>.</p>
<h3 class="fn"><a name="StyleHint-enum" />QFont.StyleHint</h3><p>Style hints are used by the <a href="qfont.html">font
matching</a> algorithm to find an appropriate default family if a
selected font family is not available.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFont.AnyStyle</tt></td>
<td class="topAlign">?</td>
<td class="topAlign">leaves the font matching algorithm to choose
the family. This is the default.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.SansSerif</tt></td>
<td class="topAlign"><tt>Helvetica</tt></td>
<td class="topAlign">the font matcher prefer sans serif fonts.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Helvetica</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">is a synonym for <tt>SansSerif</tt>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Serif</tt></td>
<td class="topAlign"><tt>Times</tt></td>
<td class="topAlign">the font matcher prefers serif fonts.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Times</tt></td>
<td class="topAlign">?</td>
<td class="topAlign">is a synonym for <tt>Serif</tt>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.TypeWriter</tt></td>
<td class="topAlign"><tt>Courier</tt></td>
<td class="topAlign">the font matcher prefers fixed pitch
fonts.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Courier</tt></td>
<td class="topAlign">?</td>
<td class="topAlign">a synonym for <tt>TypeWriter</tt>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.OldEnglish</tt></td>
<td class="topAlign">?</td>
<td class="topAlign">the font matcher prefers decorative
fonts.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Decorative</tt></td>
<td class="topAlign"><tt>OldEnglish</tt></td>
<td class="topAlign">is a synonym for <tt>OldEnglish</tt>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Monospace</tt></td>
<td class="topAlign">?</td>
<td class="topAlign">the font matcher prefers fonts that map to the
CSS generic font-family 'monospace'.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Fantasy</tt></td>
<td class="topAlign">?</td>
<td class="topAlign">the font matcher prefers fonts that map to the
CSS generic font-family 'fantasy'.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Cursive</tt></td>
<td class="topAlign">?</td>
<td class="topAlign">the font matcher prefers fonts that map to the
CSS generic font-family 'cursive'.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.System</tt></td>
<td class="topAlign">?</td>
<td class="topAlign">the font matcher prefers system fonts.</td>
</tr>
</table>
<h3 class="fn"><a name="StyleStrategy-enum" />QFont.StyleStrategy</h3><p>The style strategy tells the <a href="qfont.html">font
matching</a> algorithm what type of fonts should be used to find an
appropriate default family.</p>
<p>The following strategies are available:</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferDefault</tt></td>
<td class="topAlign"><tt>0x0001</tt></td>
<td class="topAlign">the default style strategy. It does not prefer
any type of font.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferBitmap</tt></td>
<td class="topAlign"><tt>0x0002</tt></td>
<td class="topAlign">prefers bitmap fonts (as opposed to outline
fonts).</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferDevice</tt></td>
<td class="topAlign"><tt>0x0004</tt></td>
<td class="topAlign">prefers device fonts.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferOutline</tt></td>
<td class="topAlign"><tt>0x0008</tt></td>
<td class="topAlign">prefers outline fonts (as opposed to bitmap
fonts).</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.ForceOutline</tt></td>
<td class="topAlign"><tt>0x0010</tt></td>
<td class="topAlign">forces the use of outline fonts.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.NoAntialias</tt></td>
<td class="topAlign"><tt>0x0100</tt></td>
<td class="topAlign">don't antialias the fonts.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferAntialias</tt></td>
<td class="topAlign"><tt>0x0080</tt></td>
<td class="topAlign">antialias if possible.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.OpenGLCompatible</tt></td>
<td class="topAlign"><tt>0x0200</tt></td>
<td class="topAlign">forces the use of OpenGL compatible
fonts.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.NoFontMerging</tt></td>
<td class="topAlign"><tt>0x8000</tt></td>
<td class="topAlign">If the font selected for a certain writing
system does not contain a character requested to draw, then Qt
automatically chooses a similar looking font that contains the
character. The NoFontMerging flag disables this feature. Please
note that enabling this flag will not prevent Qt from automatically
picking a suitable font when the selected font does not support the
writing system of the text.</td>
</tr>
</table>
<p>Any of these may be OR-ed with one of these flags:</p>
<table class="valuelist">
<tr class="even" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferMatch</tt></td>
<td class="topAlign"><tt>0x0020</tt></td>
<td class="topAlign">prefer an exact match. The font matcher will
try to use the exact font size that has been specified.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.PreferQuality</tt></td>
<td class="topAlign"><tt>0x0040</tt></td>
<td class="topAlign">prefer the best quality font. The font matcher
will use the nearest standard point size that the font
supports.</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.ForceIntegerMetrics</tt></td>
<td class="topAlign"><tt>0x0400</tt></td>
<td class="topAlign">forces the use of integer values in font
engines that support fractional font metrics.</td>
</tr>
</table>
<h3 class="fn"><a name="Weight-enum" />QFont.Weight</h3><p>Qt uses a weighting scale from 0 to 99 similar to, but not the
same as, the scales used in Windows or CSS. A weight of 0 is
ultralight, whilst 99 will be an extremely black.</p>
<p>This enum contains the predefined font weights:</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Light</tt></td>
<td class="topAlign"><tt>25</tt></td>
<td class="topAlign">25</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Normal</tt></td>
<td class="topAlign"><tt>50</tt></td>
<td class="topAlign">50</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.DemiBold</tt></td>
<td class="topAlign"><tt>63</tt></td>
<td class="topAlign">63</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Bold</tt></td>
<td class="topAlign"><tt>75</tt></td>
<td class="topAlign">75</td>
</tr>
<tr>
<td class="topAlign"><tt>QFont.Black</tt></td>
<td class="topAlign"><tt>87</tt></td>
<td class="topAlign">87</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QFont" />QFont.__init__ (<i>self</i>)</h3><p>Constructs a font object that uses the application's default
font.</p>
<p><b>See also</b> <a href="qapplication.html#setFont">QApplication.setFont</a>() and
<a href="qapplication.html#font">QApplication.font</a>().</p>
<h3 class="fn"><a name="QFont-2" />QFont.__init__ (<i>self</i>, QString <i>family</i>, int <i>pointSize</i> = -1, int <i>weight</i> = -1, bool <i>italic</i> = False)</h3><p>Constructs a font object with the specified <i>family</i>,
<i>pointSize</i>, <i>weight</i> and <i>italic</i> settings.</p>
<p>If <i>pointSize</i> is zero or negative, the point size of the
font is set to a system-dependent default value. Generally, this is
12 points, except on Symbian where it is 7 points.</p>
<p>The <i>family</i> name may optionally also include a foundry
name, e.g. "Helvetica [Cronyx]". If the <i>family</i> is available
from more than one foundry and the foundry isn't specified, an
arbitrary foundry is chosen. If the family isn't available a family
will be set using the <a href="qfont.html">font matching</a>
algorithm.</p>
<p><b>See also</b> <a href="qfont.html#Weight-enum">Weight</a>,
<a href="qfont.html#setFamily">setFamily</a>(), <a href="qfont.html#setPointSize">setPointSize</a>(), <a href="qfont.html#setWeight">setWeight</a>(), <a href="qfont.html#setItalic">setItalic</a>(), <a href="qfont.html#setStyleHint">setStyleHint</a>(), and <a href="qapplication.html#font">QApplication.font</a>().</p>
<h3 class="fn"><a name="QFont-3" />QFont.__init__ (<i>self</i>, <a href="qfont.html">QFont</a>, <a href="qpaintdevice.html">QPaintDevice</a> <i>pd</i>)</h3><p>Constructs a font from <i>font</i> for use on the paint device
<i>pd</i>.</p>
<h3 class="fn"><a name="QFont-4" />QFont.__init__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>Constructs a font that is a copy of <i>font</i>.</p>
<h3 class="fn"><a name="QFont-5" />QFont.__init__ (<i>self</i>, QVariant <i>variant</i>)</h3><h3 class="fn"><a name="bold" />bool QFont.bold (<i>self</i>)</h3><p>Returns true if <a href="qfont.html#weight">weight</a>() is a
value greater than <a href="qfont.html#Weight-enum">QFont.Normal</a>; otherwise returns
false.</p>
<p><b>See also</b> <a href="qfont.html#weight">weight</a>(),
<a href="qfont.html#setBold">setBold</a>(), and <a href="qfontinfo.html#bold">QFontInfo.bold</a>().</p>
<h3 class="fn"><a name="cacheStatistics" />QFont.cacheStatistics ()</h3><h3 class="fn"><a name="capitalization" /><a href="qfont.html#Capitalization-enum">Capitalization</a> QFont.capitalization (<i>self</i>)</h3><p>Returns the current capitalization type of the font.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qfont.html#setCapitalization">setCapitalization</a>().</p>
<h3 class="fn"><a name="cleanup" />QFont.cleanup ()</h3><h3 class="fn"><a name="defaultFamily" />QString QFont.defaultFamily (<i>self</i>)</h3><p>Returns the family name that corresponds to the current style
hint.</p>
<p><b>See also</b> <a href="qfont.html#StyleHint-enum">StyleHint</a>, <a href="qfont.html#styleHint">styleHint</a>(), and <a href="qfont.html#setStyleHint">setStyleHint</a>().</p>
<h3 class="fn"><a name="exactMatch" />bool QFont.exactMatch (<i>self</i>)</h3><p>Returns true if a window system font exactly matching the
settings of this font is available.</p>
<p><b>See also</b> <a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="family" />QString QFont.family (<i>self</i>)</h3><p>Returns the requested font family name, i.e. the name set in the
constructor or the last setFont() call.</p>
<p><b>See also</b> <a href="qfont.html#setFamily">setFamily</a>(),
<a href="qfont.html#substitutes">substitutes</a>(), and <a href="qfont.html#substitute">substitute</a>().</p>
<h3 class="fn"><a name="fixedPitch" />bool QFont.fixedPitch (<i>self</i>)</h3><p>Returns true if fixed pitch has been set; otherwise returns
false.</p>
<p><b>See also</b> <a href="qfont.html#setFixedPitch">setFixedPitch</a>() and <a href="qfontinfo.html#fixedPitch">QFontInfo.fixedPitch</a>().</p>
<h3 class="fn"><a name="fromString" />bool QFont.fromString (<i>self</i>, QString)</h3><p>Sets this font to match the description <i>descrip</i>. The
description is a comma-separated list of the font attributes, as
returned by <a href="qfont.html#toString">toString</a>().</p>
<p><b>See also</b> <a href="qfont.html#toString">toString</a>().</p>
<h3 class="fn"><a name="handle" />int QFont.handle (<i>self</i>)</h3><p>Returns the window system handle to the font, for low-level
access. Using this function is <i>not</i> portable.</p>
<h3 class="fn"><a name="hintingPreference" /><a href="qfont.html#HintingPreference-enum">HintingPreference</a> QFont.hintingPreference (<i>self</i>)</h3><p>Returns the currently preferred hinting level for glyphs
rendered with this font.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qfont.html#setHintingPreference">setHintingPreference</a>().</p>
<h3 class="fn"><a name="initialize" />QFont.initialize ()</h3><h3 class="fn"><a name="insertSubstitution" />QFont.insertSubstitution (QString, QString)</h3><p>Inserts <i>substituteName</i> into the substitution table for
the family <i>familyName</i>.</p>
<p><b>See also</b> <a href="qfont.html#insertSubstitutions">insertSubstitutions</a>(),
<a href="qfont.html#removeSubstitution">removeSubstitution</a>(),
<a href="qfont.html#substitutions">substitutions</a>(), <a href="qfont.html#substitute">substitute</a>(), and <a href="qfont.html#substitutes">substitutes</a>().</p>
<h3 class="fn"><a name="insertSubstitutions" />QFont.insertSubstitutions (QString, QStringList)</h3><p>Inserts the list of families <i>substituteNames</i> into the
substitution list for <i>familyName</i>.</p>
<p><b>See also</b> <a href="qfont.html#insertSubstitution">insertSubstitution</a>(), <a href="qfont.html#removeSubstitution">removeSubstitution</a>(), <a href="qfont.html#substitutions">substitutions</a>(), and <a href="qfont.html#substitute">substitute</a>().</p>
<h3 class="fn"><a name="isCopyOf" />bool QFont.isCopyOf (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>Returns true if this font and <i>f</i> are copies of each other,
i.e. one of them was created as a copy of the other and neither has
been modified since. This is much stricter than equality.</p>
<p><b>See also</b> <a href="qfont.html#operator-eq">operator=</a>()
and <a href="qfont.html#operator-eq-eq">operator==</a>().</p>
<h3 class="fn"><a name="italic" />bool QFont.italic (<i>self</i>)</h3><p>Returns true if the <a href="qfont.html#style">style</a>() of
the font is not <a href="qfont.html#Style-enum">QFont.StyleNormal</a></p>
<p><b>See also</b> <a href="qfont.html#setItalic">setItalic</a>()
and <a href="qfont.html#style">style</a>().</p>
<h3 class="fn"><a name="kerning" />bool QFont.kerning (<i>self</i>)</h3><p>Returns true if kerning should be used when drawing text with
this font.</p>
<p><b>See also</b> <a href="qfont.html#setKerning">setKerning</a>().</p>
<h3 class="fn"><a name="key" />QString QFont.key (<i>self</i>)</h3><p>Returns the font's key, a textual representation of a font. It
is typically used as the key for a cache or dictionary of
fonts.</p>
<p><b>See also</b> <a href="qmap.html">QMap</a>.</p>
<h3 class="fn"><a name="lastResortFamily" />QString QFont.lastResortFamily (<i>self</i>)</h3><p>Returns the "last resort" font family name.</p>
<p>The current implementation tries a wide variety of common fonts,
returning the first one it finds. Is is possible that no family is
found in which case an empty string is returned.</p>
<p><b>See also</b> <a href="qfont.html#lastResortFont">lastResortFont</a>().</p>
<h3 class="fn"><a name="lastResortFont" />QString QFont.lastResortFont (<i>self</i>)</h3><p>Returns a "last resort" font name for the font matching
algorithm. This is used if the last resort family is not available.
It will always return a name, if necessary returning something like
"fixed" or "system".</p>
<p>The current implementation tries a wide variety of common fonts,
returning the first one it finds. The implementation may change at
any time, but this function will always return a string containing
something.</p>
<p>It is theoretically possible that there really isn't a
lastResortFont() in which case Qt will abort with an error message.
We have not been able to identify a case where this happens. Please
<a href="bughowto.html">report it as a bug</a> if it does,
preferably with a list of the fonts you have installed.</p>
<p><b>See also</b> <a href="qfont.html#lastResortFamily">lastResortFamily</a>() and <a href="qfont.html#rawName">rawName</a>().</p>
<h3 class="fn"><a name="letterSpacing" />float QFont.letterSpacing (<i>self</i>)</h3><p>Returns the letter spacing for the font.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qfont.html#setLetterSpacing">setLetterSpacing</a>(), <a href="qfont.html#letterSpacingType">letterSpacingType</a>(), and
<a href="qfont.html#setWordSpacing">setWordSpacing</a>().</p>
<h3 class="fn"><a name="letterSpacingType" /><a href="qfont.html#SpacingType-enum">SpacingType</a> QFont.letterSpacingType (<i>self</i>)</h3><p>Returns the spacing type used for letter spacing.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qfont.html#letterSpacing">letterSpacing</a>(), <a href="qfont.html#setLetterSpacing">setLetterSpacing</a>(), and <a href="qfont.html#setWordSpacing">setWordSpacing</a>().</p>
<h3 class="fn"><a name="overline" />bool QFont.overline (<i>self</i>)</h3><p>Returns true if overline has been set; otherwise returns
false.</p>
<p><b>See also</b> <a href="qfont.html#setOverline">setOverline</a>().</p>
<h3 class="fn"><a name="pixelSize" />int QFont.pixelSize (<i>self</i>)</h3><p>Returns the pixel size of the font if it was set with <a href="qfont.html#setPixelSize">setPixelSize</a>(). Returns -1 if the
size was set with <a href="qfont.html#setPointSize">setPointSize</a>() or <a href="qfont.html#setPointSizeF">setPointSizeF</a>().</p>
<p><b>See also</b> <a href="qfont.html#setPixelSize">setPixelSize</a>(), <a href="qfont.html#pointSize">pointSize</a>(), <a href="qfontinfo.html#pointSize">QFontInfo.pointSize</a>(), and <a href="qfontinfo.html#pixelSize">QFontInfo.pixelSize</a>().</p>
<h3 class="fn"><a name="pointSize" />int QFont.pointSize (<i>self</i>)</h3><p>Returns the point size of the font. Returns -1 if the font size
was specified in pixels.</p>
<p><b>See also</b> <a href="qfont.html#setPointSize">setPointSize</a>() and <a href="qfont.html#pointSizeF">pointSizeF</a>().</p>
<h3 class="fn"><a name="pointSizeF" />float QFont.pointSizeF (<i>self</i>)</h3><p>Returns the point size of the font. Returns -1 if the font size
was specified in pixels.</p>
<p><b>See also</b> <a href="qfont.html#pointSize">pointSize</a>(),
<a href="qfont.html#setPointSizeF">setPointSizeF</a>(), <a href="qfont.html#pixelSize">pixelSize</a>(), <a href="qfontinfo.html#pointSize">QFontInfo.pointSize</a>(), and <a href="qfontinfo.html#pixelSize">QFontInfo.pixelSize</a>().</p>
<h3 class="fn"><a name="rawMode" />bool QFont.rawMode (<i>self</i>)</h3><p>Returns true if raw mode is used for font name matching;
otherwise returns false.</p>
<p><b>See also</b> <a href="qfont.html#setRawMode">setRawMode</a>()
and <a href="qfont.html#rawName">rawName</a>().</p>
<h3 class="fn"><a name="rawName" />QString QFont.rawName (<i>self</i>)</h3><p>Returns the name of the font within the underlying window
system.</p>
<p>On X11, this function will return an empty string if Qt is built
with FontConfig support; otherwise the XLFD (X Logical Font
Description) is returned.</p>
<p>Using the return value of this function is usually <i>not</i>
<i>portable</i>.</p>
<p><b>See also</b> <a href="qfont.html#setRawName">setRawName</a>().</p>
<h3 class="fn"><a name="removeSubstitution" />QFont.removeSubstitution (QString)</h3><p>Removes all the substitutions for <i>familyName</i>.</p>
<p><b>See also</b> <a href="qfont.html#insertSubstitutions">insertSubstitutions</a>(),
<a href="qfont.html#insertSubstitution">insertSubstitution</a>(),
<a href="qfont.html#substitutions">substitutions</a>(), and
<a href="qfont.html#substitute">substitute</a>().</p>
<h3 class="fn"><a name="resolve" /><a href="qfont.html">QFont</a> QFont.resolve (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>Returns a new <a href="qfont.html">QFont</a> that has attributes
copied from <i>other</i> that have not been previously set on this
font.</p>
<h3 class="fn"><a name="setBold" />QFont.setBold (<i>self</i>, bool <i>enable</i>)</h3><p>If <i>enable</i> is true sets the font's weight to <a href="qfont.html#Weight-enum">QFont.Bold</a>; otherwise sets the weight
to <a href="qfont.html#Weight-enum">QFont.Normal</a>.</p>
<p>For finer boldness control use <a href="qfont.html#setWeight">setWeight</a>().</p>
<p><b>See also</b> <a href="qfont.html#bold">bold</a>() and
<a href="qfont.html#setWeight">setWeight</a>().</p>
<h3 class="fn"><a name="setCapitalization" />QFont.setCapitalization (<i>self</i>, <a href="qfont.html#Capitalization-enum">Capitalization</a>)</h3><p>Sets the capitalization of the text in this font to
<i>caps</i>.</p>
<p>A font's capitalization makes the text appear in the selected
capitalization mode.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qfont.html#capitalization">capitalization</a>().</p>
<h3 class="fn"><a name="setFamily" />QFont.setFamily (<i>self</i>, QString)</h3><p>Sets the family name of the font. The name is case insensitive
and may include a foundry name.</p>
<p>The <i>family</i> name may optionally also include a foundry
name, e.g. "Helvetica [Cronyx]". If the <i>family</i> is available
from more than one foundry and the foundry isn't specified, an
arbitrary foundry is chosen. If the family isn't available a family
will be set using the <a href="qfont.html">font matching</a>
algorithm.</p>
<p><b>See also</b> <a href="qfont.html#family">family</a>(),
<a href="qfont.html#setStyleHint">setStyleHint</a>(), and <a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="setFixedPitch" />QFont.setFixedPitch (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, sets fixed pitch on; otherwise sets
fixed pitch off.</p>
<p><b>See also</b> <a href="qfont.html#fixedPitch">fixedPitch</a>()
and <a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="setHintingPreference" />QFont.setHintingPreference (<i>self</i>, <a href="qfont.html#HintingPreference-enum">HintingPreference</a> <i>hintingPreference</i>)</h3><p>Set the preference for the hinting level of the glyphs to
<i>hintingPreference</i>. This is a hint to the underlying font
rendering system to use a certain level of hinting, and has varying
support across platforms. See the table in the documentation for
<a href="qfont.html#HintingPreference-enum">QFont.HintingPreference</a>
for more details.</p>
<p>The default hinting preference is <a href="qfont.html#HintingPreference-enum">QFont.PreferDefaultHinting</a>.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qfont.html#hintingPreference">hintingPreference</a>().</p>
<h3 class="fn"><a name="setItalic" />QFont.setItalic (<i>self</i>, bool <i>b</i>)</h3><p>Sets the <a href="qfont.html#style">style</a>() of the font to
<a href="qfont.html#Style-enum">QFont.StyleItalic</a> if
<i>enable</i> is true; otherwise the style is set to <a href="qfont.html#Style-enum">QFont.StyleNormal</a>.</p>
<p><b>See also</b> <a href="qfont.html#italic">italic</a>() and
<a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="setKerning" />QFont.setKerning (<i>self</i>, bool)</h3><p>Enables kerning for this font if <i>enable</i> is true;
otherwise disables it. By default, kerning is enabled.</p>
<p>When kerning is enabled, glyph metrics do not add up anymore,
even for Latin text. In other words, the assumption that width('a')
+ width('b') is equal to width("ab") is not neccesairly true.</p>
<p><b>See also</b> <a href="qfont.html#kerning">kerning</a>() and
<a href="qfontmetrics.html">QFontMetrics</a>.</p>
<h3 class="fn"><a name="setLetterSpacing" />QFont.setLetterSpacing (<i>self</i>, <a href="qfont.html#SpacingType-enum">SpacingType</a> <i>type</i>, float <i>spacing</i>)</h3><p>Sets the letter spacing for the font to <i>spacing</i> and the
type of spacing to <i>type</i>.</p>
<p>Letter spacing changes the default spacing between individual
letters in the font. The spacing between the letters can be made
smaller as well as larger.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qfont.html#letterSpacing">letterSpacing</a>(), <a href="qfont.html#letterSpacingType">letterSpacingType</a>(), and
<a href="qfont.html#setWordSpacing">setWordSpacing</a>().</p>
<h3 class="fn"><a name="setOverline" />QFont.setOverline (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, sets overline on; otherwise sets
overline off.</p>
<p><b>See also</b> <a href="qfont.html#overline">overline</a>() and
<a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="setPixelSize" />QFont.setPixelSize (<i>self</i>, int)</h3><p>Sets the font size to <i>pixelSize</i> pixels.</p>
<p>Using this function makes the font device dependent. Use
<a href="qfont.html#setPointSize">setPointSize</a>() or <a href="qfont.html#setPointSizeF">setPointSizeF</a>() to set the size of
the font in a device independent manner.</p>
<p><b>See also</b> <a href="qfont.html#pixelSize">pixelSize</a>().</p>
<h3 class="fn"><a name="setPointSize" />QFont.setPointSize (<i>self</i>, int)</h3><p>Sets the point size to <i>pointSize</i>. The point size must be
greater than zero.</p>
<p><b>See also</b> <a href="qfont.html#pointSize">pointSize</a>()
and <a href="qfont.html#setPointSizeF">setPointSizeF</a>().</p>
<h3 class="fn"><a name="setPointSizeF" />QFont.setPointSizeF (<i>self</i>, float)</h3><p>Sets the point size to <i>pointSize</i>. The point size must be
greater than zero. The requested precision may not be achieved on
all platforms.</p>
<p><b>See also</b> <a href="qfont.html#pointSizeF">pointSizeF</a>(), <a href="qfont.html#setPointSize">setPointSize</a>(), and <a href="qfont.html#setPixelSize">setPixelSize</a>().</p>
<h3 class="fn"><a name="setRawMode" />QFont.setRawMode (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, turns raw mode on; otherwise turns raw
mode off. This function only has an effect under X11.</p>
<p>If raw mode is enabled, Qt will search for an X font with a
complete font name matching the family name, ignoring all other
values set for the <a href="qfont.html">QFont</a>. If the font name
matches several fonts, Qt will use the first font returned by X.
<a href="qfontinfo.html">QFontInfo</a> <i>cannot</i> be used to
fetch information about a <a href="qfont.html">QFont</a> using raw
mode (it will return the values set in the <a href="qfont.html">QFont</a> for all parameters, including the family
name).</p>
<p><b>Warning:</b> Do not use raw mode unless you really, really
need it! In most (if not all) cases, <a href="qfont.html#setRawName">setRawName</a>() is a much better
choice.</p>
<p><b>See also</b> <a href="qfont.html#rawMode">rawMode</a>() and
<a href="qfont.html#setRawName">setRawName</a>().</p>
<h3 class="fn"><a name="setRawName" />QFont.setRawName (<i>self</i>, QString)</h3><p>Sets a font by its system specific name. The function is
particularly useful under X, where system font settings (for
example X resources) are usually available in XLFD (X Logical Font
Description) form only. You can pass an XLFD as <i>name</i> to this
function.</p>
<p>A font set with setRawName() is still a full-featured <a href="qfont.html">QFont</a>. It can be queried (for example with
<a href="qfont.html#italic">italic</a>()) or modified (for example
with <a href="qfont.html#setItalic">setItalic</a>()) and is
therefore also suitable for rendering rich text.</p>
<p>If Qt's internal font database cannot resolve the raw name, the
font becomes a raw font with <i>name</i> as its family.</p>
<p>Note that the present implementation does not handle wildcards
in XLFDs well, and that font aliases (file <tt>fonts.alias</tt> in
the font directory on X11) are not supported.</p>
<p><b>See also</b> <a href="qfont.html#rawName">rawName</a>(),
<a href="qfont.html#setRawMode">setRawMode</a>(), and <a href="qfont.html#setFamily">setFamily</a>().</p>
<h3 class="fn"><a name="setStretch" />QFont.setStretch (<i>self</i>, int)</h3><p>Sets the stretch factor for the font.</p>
<p>The stretch factor changes the width of all characters in the
font by <i>factor</i> percent. For example, setting <i>factor</i>
to 150 results in all characters in the font being 1.5 times (ie.
150%) wider. The default stretch factor is 100. The minimum stretch
factor is 1, and the maximum stretch factor is 4000.</p>
<p>The stretch factor is only applied to outline fonts. The stretch
factor is ignored for bitmap fonts.</p>
<p>NOTE: <a href="qfont.html">QFont</a> cannot stretch XLFD fonts.
When loading XLFD fonts on X11, the stretch factor is matched
against a predefined set of values for the SETWIDTH_NAME field of
the XLFD.</p>
<p><b>See also</b> <a href="qfont.html#stretch">stretch</a>() and
<a href="qfont.html#Stretch-enum">QFont.Stretch</a>.</p>
<h3 class="fn"><a name="setStrikeOut" />QFont.setStrikeOut (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, sets strikeout on; otherwise sets
strikeout off.</p>
<p><b>See also</b> <a href="qfont.html#strikeOut">strikeOut</a>()
and <a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="setStyle" />QFont.setStyle (<i>self</i>, <a href="qfont.html#Style-enum">Style</a> <i>style</i>)</h3><p>Sets the style of the font to <i>style</i>.</p>
<p><b>See also</b> <a href="qfont.html#style">style</a>(), <a href="qfont.html#italic">italic</a>(), and <a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="setStyleHint" />QFont.setStyleHint (<i>self</i>, <a href="qfont.html#StyleHint-enum">StyleHint</a> <i>hint</i>, <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a> <i>strategy</i> = QFont.PreferDefault)</h3><p>Sets the style hint and strategy to <i>hint</i> and
<i>strategy</i>, respectively.</p>
<p>If these aren't set explicitly the style hint will default to
<tt>AnyStyle</tt> and the style strategy to
<tt>PreferDefault</tt>.</p>
<p>Qt does not support style hints on X11 since this information is
not provided by the window system.</p>
<p><b>See also</b> <a href="qfont.html#StyleHint-enum">StyleHint</a>, <a href="qfont.html#styleHint">styleHint</a>(), <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a>, <a href="qfont.html#styleStrategy">styleStrategy</a>(), and <a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="setStyleName" />QFont.setStyleName (<i>self</i>, QString <i>styleName</i>)</h3><p>Sets the style name of the font to the given <i>styleName</i>.
When set, other style properties like <a href="qfont.html#style">style</a>() and <a href="qfont.html#weight">weight</a>() will be ignored for font
matching.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qfont.html#styleName">styleName</a>().</p>
<h3 class="fn"><a name="setStyleStrategy" />QFont.setStyleStrategy (<i>self</i>, <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a> <i>s</i>)</h3><p>Sets the style strategy for the font to <i>s</i>.</p>
<p><b>See also</b> <a href="qfont.html#styleStrategy">styleStrategy</a>() and <a href="qfont.html#StyleStrategy-enum">QFont.StyleStrategy</a>.</p>
<h3 class="fn"><a name="setUnderline" />QFont.setUnderline (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, sets underline on; otherwise sets
underline off.</p>
<p><b>See also</b> <a href="qfont.html#underline">underline</a>()
and <a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="setWeight" />QFont.setWeight (<i>self</i>, int)</h3><p>Sets the weight the font to <i>weight</i>, which should be a
value from the <a href="qfont.html#Weight-enum">QFont.Weight</a>
enumeration.</p>
<p><b>See also</b> <a href="qfont.html#weight">weight</a>() and
<a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="setWordSpacing" />QFont.setWordSpacing (<i>self</i>, float <i>spacing</i>)</h3><p>Sets the word spacing for the font to <i>spacing</i>.</p>
<p>Word spacing changes the default spacing between individual
words. A positive value increases the word spacing by a
corresponding amount of pixels, while a negative value decreases
the inter-word spacing accordingly.</p>
<p>Word spacing will not apply to writing systems, where indiviaul
words are not separated by white space.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qfont.html#wordSpacing">wordSpacing</a>() and <a href="qfont.html#setLetterSpacing">setLetterSpacing</a>().</p>
<h3 class="fn"><a name="stretch" />int QFont.stretch (<i>self</i>)</h3><p>Returns the stretch factor for the font.</p>
<p><b>See also</b> <a href="qfont.html#setStretch">setStretch</a>().</p>
<h3 class="fn"><a name="strikeOut" />bool QFont.strikeOut (<i>self</i>)</h3><p>Returns true if strikeout has been set; otherwise returns
false.</p>
<p><b>See also</b> <a href="qfont.html#setStrikeOut">setStrikeOut</a>().</p>
<h3 class="fn"><a name="style" /><a href="qfont.html#Style-enum">Style</a> QFont.style (<i>self</i>)</h3><p>Returns the style of the font.</p>
<p><b>See also</b> <a href="qfont.html#setStyle">setStyle</a>().</p>
<h3 class="fn"><a name="styleHint" /><a href="qfont.html#StyleHint-enum">StyleHint</a> QFont.styleHint (<i>self</i>)</h3><p>Returns the <a href="qfont.html#StyleHint-enum">StyleHint</a>.</p>
<p>The style hint affects the <a href="qfont.html">font
matching</a> algorithm. See <a href="qfont.html#StyleHint-enum">QFont.StyleHint</a> for the list of
available hints.</p>
<p><b>See also</b> <a href="qfont.html#setStyleHint">setStyleHint</a>(), <a href="qfont.html#StyleStrategy-enum">QFont.StyleStrategy</a>, and
<a href="qfontinfo.html#styleHint">QFontInfo.styleHint</a>().</p>
<h3 class="fn"><a name="styleName" />QString QFont.styleName (<i>self</i>)</h3><p>Returns the requested font style name, it will be used to match
the font with irregular styles (that can't be normalized in other
style properties). It depends on system font support, thus only
works for Mac OS X and X11 so far. On Windows irregular styles will
be added as separate font families so there is no need for
this.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qfont.html#setStyleName">setStyleName</a>(), <a href="qfont.html#setFamily">setFamily</a>(), and <a href="qfont.html#setStyle">setStyle</a>().</p>
<h3 class="fn"><a name="styleStrategy" /><a href="qfont.html#StyleStrategy-enum">StyleStrategy</a> QFont.styleStrategy (<i>self</i>)</h3><p>Returns the <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a>.</p>
<p>The style strategy affects the <a href="qfont.html">font
matching</a> algorithm. See <a href="qfont.html#StyleStrategy-enum">QFont.StyleStrategy</a> for the
list of available strategies.</p>
<p><b>See also</b> <a href="qfont.html#setStyleStrategy">setStyleStrategy</a>(), <a href="qfont.html#setStyleHint">setStyleHint</a>(), and <a href="qfont.html#StyleHint-enum">QFont.StyleHint</a>.</p>
<h3 class="fn"><a name="substitute" />QString QFont.substitute (QString)</h3><p>Returns the first family name to be used whenever
<i>familyName</i> is specified. The lookup is case insensitive.</p>
<p>If there is no substitution for <i>familyName</i>,
<i>familyName</i> is returned.</p>
<p>To obtain a list of substitutions use <a href="qfont.html#substitutes">substitutes</a>().</p>
<p><b>See also</b> <a href="qfont.html#setFamily">setFamily</a>(),
<a href="qfont.html#insertSubstitutions">insertSubstitutions</a>(),
<a href="qfont.html#insertSubstitution">insertSubstitution</a>(),
and <a href="qfont.html#removeSubstitution">removeSubstitution</a>().</p>
<h3 class="fn"><a name="substitutes" />QStringList QFont.substitutes (QString)</h3><p>Returns a list of family names to be used whenever
<i>familyName</i> is specified. The lookup is case insensitive.</p>
<p>If there is no substitution for <i>familyName</i>, an empty list
is returned.</p>
<p><b>See also</b> <a href="qfont.html#substitute">substitute</a>(), <a href="qfont.html#insertSubstitutions">insertSubstitutions</a>(),
<a href="qfont.html#insertSubstitution">insertSubstitution</a>(),
and <a href="qfont.html#removeSubstitution">removeSubstitution</a>().</p>
<h3 class="fn"><a name="substitutions" />QStringList QFont.substitutions ()</h3><p>Returns a sorted list of substituted family names.</p>
<p><b>See also</b> <a href="qfont.html#insertSubstitution">insertSubstitution</a>(), <a href="qfont.html#removeSubstitution">removeSubstitution</a>(), and
<a href="qfont.html#substitute">substitute</a>().</p>
<h3 class="fn"><a name="toString" />QString QFont.toString (<i>self</i>)</h3><p>Returns a description of the font. The description is a
comma-separated list of the attributes, perfectly suited for use in
<a href="qsettings.html">QSettings</a>.</p>
<p><b>See also</b> <a href="qfont.html#fromString">fromString</a>().</p>
<h3 class="fn"><a name="underline" />bool QFont.underline (<i>self</i>)</h3><p>Returns true if underline has been set; otherwise returns
false.</p>
<p><b>See also</b> <a href="qfont.html#setUnderline">setUnderline</a>().</p>
<h3 class="fn"><a name="weight" />int QFont.weight (<i>self</i>)</h3><p>Returns the weight of the font which is one of the enumerated
values from <a href="qfont.html#Weight-enum">QFont.Weight</a>.</p>
<p><b>See also</b> <a href="qfont.html#setWeight">setWeight</a>(),
<a href="qfont.html#Weight-enum">Weight</a>, and <a href="qfontinfo.html">QFontInfo</a>.</p>
<h3 class="fn"><a name="wordSpacing" />float QFont.wordSpacing (<i>self</i>)</h3><p>Returns the word spacing for the font.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qfont.html#setWordSpacing">setWordSpacing</a>() and <a href="qfont.html#setLetterSpacing">setLetterSpacing</a>().</p>
<h3 class="fn"><a name="__eq__" />bool QFont.__eq__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><h3 class="fn"><a name="__ge__" />bool QFont.__ge__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><h3 class="fn"><a name="__lt__" />bool QFont.__lt__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><h3 class="fn"><a name="__ne__" />bool QFont.__ne__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|