summaryrefslogtreecommitdiffstats
path: root/doc/html/qfont.html
blob: 3f60643fdc7d8404203761b2cafb6eb777436b51 (plain)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qfont.cpp:236 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQFont Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQFont Class Reference</h1>

<p>The TQFont class specifies a font used for drawing text.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qfont-h.html">qfont.h</a>&gt;</tt>
<p><a href="qfont-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#StyleHint-enum"><b>StyleHint</b></a> { Helvetica, SansSerif = Helvetica, Times, Serif = Times, Courier, TypeWriter = Courier, OldEnglish, Decorative = OldEnglish, System, AnyStyle }</li>
<li class=fn>enum <a href="#StyleStrategy-enum"><b>StyleStrategy</b></a> { PreferDefault = 0x0001, PreferBitmap = 0x0002, PreferDevice = 0x0004, PreferOutline = 0x0008, ForceOutline = 0x0010, PreferMatch = 0x0020, PreferQuality = 0x0040, PreferAntialias = 0x0080, NoAntialias = 0x0100, OpenGLCompatible = 0x0200 }</li>
<li class=fn>enum <a href="#Weight-enum"><b>Weight</b></a> { Light = 25, Normal = 50, DemiBold = 63, Bold = 75, Black = 87 }</li>
<li class=fn>enum <a href="#Stretch-enum"><b>Stretch</b></a> { UltraCondensed = 50, ExtraCondensed = 62, Condensed = 75, SemiCondensed = 87, Unstretched = 100, SemiExpanded = 112, Expanded = 125, ExtraExpanded = 150, UltraExpanded = 200 }</li>
<li class=fn><a href="#TQFont"><b>TQFont</b></a> ()</li>
<li class=fn><a href="#TQFont-2"><b>TQFont</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;family, int&nbsp;pointSize = 12, int&nbsp;weight = Normal, bool&nbsp;italic = FALSE )</li>
<li class=fn><a href="#TQFont-3"><b>TQFont</b></a> ( const&nbsp;TQFont&nbsp;&amp;&nbsp;font )</li>
<li class=fn><a href="#~TQFont"><b>~TQFont</b></a> ()</li>
<li class=fn>TQString <a href="#family"><b>family</b></a> () const</li>
<li class=fn>void <a href="#setFamily"><b>setFamily</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;family )</li>
<li class=fn>int <a href="#pointSize"><b>pointSize</b></a> () const</li>
<li class=fn>float <a href="#pointSizeFloat"><b>pointSizeFloat</b></a> () const</li>
<li class=fn>void <a href="#setPointSize"><b>setPointSize</b></a> ( int&nbsp;pointSize )</li>
<li class=fn>void <a href="#setPointSizeFloat"><b>setPointSizeFloat</b></a> ( float&nbsp;pointSize )</li>
<li class=fn>int <a href="#pixelSize"><b>pixelSize</b></a> () const</li>
<li class=fn>void <a href="#setPixelSize"><b>setPixelSize</b></a> ( int&nbsp;pixelSize )</li>
<li class=fn>void setPixelSizeFloat ( float&nbsp;pixelSize ) &nbsp;<em>(obsolete)</em></li>
<li class=fn>int <a href="#weight"><b>weight</b></a> () const</li>
<li class=fn>void <a href="#setWeight"><b>setWeight</b></a> ( int&nbsp;weight )</li>
<li class=fn>bool <a href="#bold"><b>bold</b></a> () const</li>
<li class=fn>void <a href="#setBold"><b>setBold</b></a> ( bool&nbsp;enable )</li>
<li class=fn>bool <a href="#italic"><b>italic</b></a> () const</li>
<li class=fn>void <a href="#setItalic"><b>setItalic</b></a> ( bool&nbsp;enable )</li>
<li class=fn>bool <a href="#underline"><b>underline</b></a> () const</li>
<li class=fn>void <a href="#setUnderline"><b>setUnderline</b></a> ( bool&nbsp;enable )</li>
<li class=fn>bool <a href="#overline"><b>overline</b></a> () const</li>
<li class=fn>void <a href="#setOverline"><b>setOverline</b></a> ( bool&nbsp;enable )</li>
<li class=fn>bool <a href="#strikeOut"><b>strikeOut</b></a> () const</li>
<li class=fn>void <a href="#setStrikeOut"><b>setStrikeOut</b></a> ( bool&nbsp;enable )</li>
<li class=fn>bool <a href="#fixedPitch"><b>fixedPitch</b></a> () const</li>
<li class=fn>void <a href="#setFixedPitch"><b>setFixedPitch</b></a> ( bool&nbsp;enable )</li>
<li class=fn>StyleHint <a href="#styleHint"><b>styleHint</b></a> () const</li>
<li class=fn>StyleStrategy <a href="#styleStrategy"><b>styleStrategy</b></a> () const</li>
<li class=fn>void <a href="#setStyleHint"><b>setStyleHint</b></a> ( StyleHint&nbsp;hint, StyleStrategy&nbsp;strategy = PreferDefault )</li>
<li class=fn>void <a href="#setStyleStrategy"><b>setStyleStrategy</b></a> ( StyleStrategy&nbsp;s )</li>
<li class=fn>int <a href="#stretch"><b>stretch</b></a> () const</li>
<li class=fn>void <a href="#setStretch"><b>setStretch</b></a> ( int&nbsp;factor )</li>
<li class=fn>bool <a href="#rawMode"><b>rawMode</b></a> () const</li>
<li class=fn>void <a href="#setRawMode"><b>setRawMode</b></a> ( bool&nbsp;enable )</li>
<li class=fn>bool <a href="#exactMatch"><b>exactMatch</b></a> () const</li>
<li class=fn>TQFont &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;TQFont&nbsp;&amp;&nbsp;font )</li>
<li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const&nbsp;TQFont&nbsp;&amp;&nbsp;f ) const</li>
<li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const&nbsp;TQFont&nbsp;&amp;&nbsp;f ) const</li>
<li class=fn>bool <a href="#isCopyOf"><b>isCopyOf</b></a> ( const&nbsp;TQFont&nbsp;&amp;&nbsp;f ) const</li>
<li class=fn>HFONT <a href="#handle"><b>handle</b></a> () const</li>
<li class=fn>void <a href="#setRawName"><b>setRawName</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;name )</li>
<li class=fn>TQString <a href="#rawName"><b>rawName</b></a> () const</li>
<li class=fn>TQString <a href="#key"><b>key</b></a> () const</li>
<li class=fn>TQString <a href="#toString"><b>toString</b></a> () const</li>
<li class=fn>bool <a href="#fromString"><b>fromString</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;descrip )</li>
<li class=fn>void <a href="#qwsRenderToDisk"><b>qwsRenderToDisk</b></a> ( bool&nbsp;all = TRUE )</li>
<li class=fn>enum <a href="#Script-enum"><b>Script</b></a> { Latin, Greek, Cyrillic, Armenian, Georgian, Runic, Ogham, SpacingModifiers, CombiningMarks, Hebrew, Arabic, Syriac, Thaana, Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Sinhala, Thai, Lao, Tibetan, Myanmar, Khmer, Han, Hiragana, Katakana, Hangul, Bopomofo, Yi, Ethiopic, Cherokee, CanadianAboriginal, Mongolian, CurrencySymbols, LetterlikeSymbols, NumberForms, MathematicalOperators, TechnicalSymbols, GeometricSymbols, MiscellaneousSymbols, EnclosedAndSquare, Braille, Unicode, Tagalog, Hanunoo, Buhid, Tagbanwa, KatakanaHalfWidth, Limbu, TaiLe }</li>
<li class=fn>TQString <a href="#defaultFamily"><b>defaultFamily</b></a> () const</li>
<li class=fn>TQString <a href="#lastResortFamily"><b>lastResortFamily</b></a> () const</li>
<li class=fn>TQString <a href="#lastResortFont"><b>lastResortFont</b></a> () const</li>
<li class=fn>TQFont <a href="#resolve"><b>resolve</b></a> ( const&nbsp;TQFont&nbsp;&amp;&nbsp;other ) const</li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li class=fn>TQString <a href="#substitute"><b>substitute</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;familyName )</li>
<li class=fn>TQStringList <a href="#substitutes"><b>substitutes</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;familyName )</li>
<li class=fn>TQStringList <a href="#substitutions"><b>substitutions</b></a> ()</li>
<li class=fn>void <a href="#insertSubstitution"><b>insertSubstitution</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;familyName, const&nbsp;TQString&nbsp;&amp;&nbsp;substituteName )</li>
<li class=fn>void <a href="#insertSubstitutions"><b>insertSubstitutions</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;familyName, const&nbsp;TQStringList&nbsp;&amp;&nbsp;substituteNames )</li>
<li class=fn>void <a href="#removeSubstitution"><b>removeSubstitution</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;familyName )</li>
<li class=fn>TQFont defaultFont () &nbsp;<em>(obsolete)</em></li>
<li class=fn>void setDefaultFont ( const&nbsp;TQFont&nbsp;&amp;&nbsp;f ) &nbsp;<em>(obsolete)</em></li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>bool <a href="#dirty"><b>dirty</b></a> () const</li>
<li class=fn>int <a href="#deciPointSize"><b>deciPointSize</b></a> () const</li>
</ul>
<h2>Related Functions</h2>
<ul>
<li class=fn>TQDataStream &amp; <a href="#operator-lt-lt"><b>operator&lt;&lt;</b></a> ( TQDataStream&nbsp;&amp;&nbsp;s, const&nbsp;TQFont&nbsp;&amp;&nbsp;font )</li>
<li class=fn>TQDataStream &amp; <a href="#operator-gt-gt"><b>operator&gt;&gt;</b></a> ( TQDataStream&nbsp;&amp;&nbsp;s, TQFont&nbsp;&amp;&nbsp;font )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQFont class specifies a font used for drawing text.
<p> 



<p> When you create a TQFont object you specify various attributes that
you want the font to have. TQt will use the font with the specified
attributes, or if no matching font exists, TQt will use the closest
matching installed font. The attributes of the font that is
actually used are retrievable from a <a href="qfontinfo.html">TQFontInfo</a> object. If the
window system provides an exact match <a href="#exactMatch">exactMatch</a>() returns TRUE.
Use <a href="qfontmetrics.html">TQFontMetrics</a> to get measurements, e.g. the pixel length of a
string using <a href="qfontmetrics.html#width">TQFontMetrics::width</a>().
<p> Use <a href="qapplication.html#setFont">TQApplication::setFont</a>() to set the application's default font.
<p> If a choosen X11 font does not include all the characters that
need to be displayed, TQFont will try to find the characters in the
nearest equivalent fonts. When a <a href="qpainter.html">TQPainter</a> draws a character from a
font the TQFont will report whether or not it has the character; if
it does not, TQPainter will draw an unfilled square.
<p> Create TQFonts like this:
<pre>
    TQFont serifFont( "Times", 10, Bold );
    TQFont sansFont( "Helvetica [Cronyx]", 12 );
    </pre>
 
<p> The attributes set in the constructor can also be set later, e.g.
<a href="#setFamily">setFamily</a>(), <a href="#setPointSize">setPointSize</a>(), <a href="#setPointSizeFloat">setPointSizeFloat</a>(), <a href="#setWeight">setWeight</a>() and
<a href="#setItalic">setItalic</a>(). The remaining attributes must be set after
contstruction, e.g. <a href="#setBold">setBold</a>(), <a href="#setUnderline">setUnderline</a>(), <a href="#setOverline">setOverline</a>(),
<a href="#setStrikeOut">setStrikeOut</a>() and <a href="#setFixedPitch">setFixedPitch</a>(). <a href="qfontinfo.html">TQFontInfo</a> objects should be
created <em>after</em> the font's attributes have been set. A TQFontInfo
object will not change, even if you change the font's
attributes. The corresponding "get" functions, e.g. <a href="#family">family</a>(),
<a href="#pointSize">pointSize</a>(), etc., return the values that were set, even though
the values used may differ. The actual values are available from a
TQFontInfo object.
<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="#StyleHint-enum">TQFont::StyleHint</a> and <a href="#StyleStrategy-enum">TQFont::StyleStrategy</a> with
<a href="#setStyleHint">setStyleHint</a>(). The default family (corresponding to the current
style hint) is returned by <a href="#defaultFamily">defaultFamily</a>().
<p> The font-matching algorithm has a <a href="#lastResortFamily">lastResortFamily</a>() and
<a href="#lastResortFont">lastResortFont</a>() in cases where a suitable match cannot be found.
You can provide substitutions for font family names using
<a href="#insertSubstitution">insertSubstitution</a>() and <a href="#insertSubstitutions">insertSubstitutions</a>(). Substitutions can
be removed with <a href="#removeSubstitution">removeSubstitution</a>(). Use <a href="#substitute">substitute</a>() to retrieve
a family's first substitute, or the family name itself if it has
no substitutes. Use <a href="#substitutes">substitutes</a>() to retrieve a list of a family's
substitutes (which may be empty).
<p> Every TQFont has a <a href="#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">TQSettings</a>, writing the font information
with <a href="#toString">toString</a>() and reading it back with <a href="#fromString">fromString</a>(). The
<a href="#operator-lt-lt">operator&lt;&lt;</a>() and <a href="#operator-gt-gt">operator&gt;&gt;</a>() functions are also available, but
they work on a data stream.
<p> It is possible to set the height of characters shown on the screen
to a specified number of pixels with <a href="#setPixelSize">setPixelSize</a>(); however using
<a href="#setPointSize">setPointSize</a>() has a similar effect and provides device
independence.
<p> Under the X Window System you can set a font using its system
specific name with <a href="#setRawName">setRawName</a>().
<p> Loading fonts can be expensive, especially on X11. TQFont contains
extensive optimizations to make the copying of TQFont objects fast,
and to cache the results of the slow window system functions it
depends upon.
<p> <a name="fontmatching"></a>
The font matching algorithm works as follows:
<ol type=1>
<li> The specified font family is searched for.
<li> If not found, the <a href="#styleHint">styleHint</a>() is used to select a replacement
family.
<li> Each replacement font family is searched for.
<li> If none of these are found or there was no styleHint(), "helvetica"
will be searched for.
<li> If "helvetica" isn't found TQt will try the <a href="#lastResortFamily">lastResortFamily</a>().
<li> If the lastResortFamily() isn't found TQt will try the
<a href="#lastResortFont">lastResortFont</a>() which will always return a name of some kind.
</ol>
<p> Once a font is found, the remaining attributes are matched in order of
priority:
<ol type=1>
<li> <a href="#fixedPitch">fixedPitch</a>()
<li> <a href="#pointSize">pointSize</a>() (see below)
<li> <a href="#weight">weight</a>()
<li> <a href="#italic">italic</a>()
</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> 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> 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">TQFontInfo</a> object can be
used to determine the actual values used for drawing the text.
<p> Examples:
<p> <pre>
    TQFont f("Helvetica");
    </pre>
 
If you had both an Adobe and a Cronyx Helvetica, you might get
either.
<p> <pre>
    TQFont f1( "Helvetica [Cronyx]" );  // TQt 3.x
    TQFont f2( "Cronyx-Helvetica" );    // TQt 2.x compatibility
    </pre>
 
You can specify the foundry you want in the family name. Both fonts,
f1 and f2, in the above example will be set to  "Helvetica
[Cronyx]".
<p> To determine the attributes of the font actually used in the window
system, use a TQFontInfo object, e.g.
<pre>
    <a href="qfontinfo.html">TQFontInfo</a> info( f1 );
    <a href="qstring.html">TQString</a> family = info.<a href="qfontinfo.html#family">family</a>();
    </pre>
 
<p> To find out font metrics use a <a href="qfontmetrics.html">TQFontMetrics</a> object, e.g.
<pre>
    <a href="qfontmetrics.html">TQFontMetrics</a> fm( f1 );
    int pixelWidth = fm.<a href="qfontmetrics.html#width">width</a>( "How many pixels wide is this text?" );
    int pixelHeight = fm.<a href="qfontmetrics.html#height">height</a>();
    </pre>
 
<p> For more general information on fonts, see the
<a href="http://www.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> <p>See also <a href="qfontmetrics.html">TQFontMetrics</a>, <a href="qfontinfo.html">TQFontInfo</a>, <a href="qfontdatabase.html">TQFontDatabase</a>, <a href="qapplication.html#setFont">TQApplication::setFont</a>(), <a href="qwidget.html#font-prop">TQWidget::font</a>, <a href="qpainter.html#setFont">TQPainter::setFont</a>(), <a href="#StyleHint-enum">TQFont::StyleHint</a>, <a href="#Weight-enum">TQFont::Weight</a>, <a href="appearance.html">Widget Appearance and Style</a>, <a href="graphics.html">Graphics Classes</a>, and <a href="shared.html">Implicitly and Explicitly Shared Classes</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="Script-enum"></a>TQFont::Script</h3>

<p> This enum represents <a href="unicode.html">Unicode</a> allocated
scripts. For exhaustive coverage see <a href="http://www.amazon.com/exec/obidos/ASIN/0201616335/trolltech/t">The
    Unicode Standard Version 3.0</a>. The following scripts are
supported:
<p> Modern European alphabetic scripts (left to right):
<ul>
<li><tt>TQFont::Latin</tt> - consists of most alphabets based on the original Latin alphabet.
<li><tt>TQFont::Greek</tt> - covers ancient and modern Greek and Coptic.
<li><tt>TQFont::Cyrillic</tt> - covers the Slavic and non-Slavic languages using
cyrillic alphabets.
<li><tt>TQFont::Armenian</tt> - contains the Armenian alphabet used with the
Armenian language.
<li><tt>TQFont::Georgian</tt> - covers at least the language Georgian.
<li><tt>TQFont::Runic</tt> - covers the known constituents of the Runic alphabets used
by the early and medieval societies in the Germanic,
Scandinavian, and Anglo-Saxon areas.
<li><tt>TQFont::Ogham</tt> - is an alphabetical script used to write a very early
form of Irish.
<li><tt>TQFont::SpacingModifiers</tt> - are small signs indicating modifications
to the preceeding letter.
<li><tt>TQFont::CombiningMarks</tt> - consist of diacritical marks not specific to
a particular alphabet, diacritical marks used in
combination with mathematical and technical symbols, and
glyph encodings applied to multiple letterforms.
</ul><p> Middle Eastern scripts (right to left):
<ul>
<li><tt>TQFont::Hebrew</tt> - is used for writing Hebrew, Yiddish, and some other languages.
<li><tt>TQFont::Arabic</tt> - covers the Arabic language as well as Persian, Urdu,
Kurdish and some others.
<li><tt>TQFont::Syriac</tt> - is used to write the active liturgical languages and
dialects of several Middle Eastern and Southeast Indian
communities.
<li><tt>TQFont::Thaana</tt> - is used to write the Maledivian Dhivehi language.
</ul><p> South and Southeast Asian scripts (left to right with few historical exceptions):
<ul>
<li><tt>TQFont::Devanagari</tt> - covers classical Sanskrit and modern Hindi as
well as several other languages.
<li><tt>TQFont::Bengali</tt> - is a relative to Devanagari employed to write the
Bengali language used in West Bengal/India and Bangladesh
as well as several minority languages.
<li><tt>TQFont::Gurmukhi</tt> - is another Devanagari relative used to write Punjabi.
<li><tt>TQFont::Gujarati</tt> - is closely related to Devanagari and used to write
the Gujarati language of the Gujarat state in India.
<li><tt>TQFont::Oriya</tt> - is used to write the Oriya language of Orissa state/India.
<li><tt>TQFont::Tamil</tt> - is used to write the Tamil language of Tamil Nadu state/India,
Sri Lanka, Singapore and parts of Malaysia as well as some
minority languages.
<li><tt>TQFont::Telugu</tt> - is used to write the Telugu language of Andhra
Pradesh state/India and some minority languages.
<li><tt>TQFont::Kannada</tt> - is another South Indian script used to write the
Kannada language of Karnataka state/India and some minority
languages.
<li><tt>TQFont::Malayalam</tt> - is used to write the Malayalam language of Kerala
state/India.
<li><tt>TQFont::Sinhala</tt> - is used for Sri Lanka's majority language Sinhala
and is also employed to write Pali, Sanskrit, and Tamil.
<li><tt>TQFont::Thai</tt> - is used to write Thai and other Southeast Asian languages.
<li><tt>TQFont::Lao</tt> - is a language and script quite similar to Thai.
<li><tt>TQFont::Tibetan</tt> - is the script used to write Tibetan in several
countries like Tibet, the bordering Indian regions and
Nepal. It is also used in the Buddist philosophy and
liturgy of the Mongolian cultural area.
<li><tt>TQFont::Myanmar</tt> - is mainly used to write the Burmese language of
Myanmar (former Burma).
<li><tt>TQFont::Khmer</tt> - is the official language of Kampuchea.
</ul><p> East Asian scripts (traditionally top-down, right to left, modern
often horizontal left to right):
<ul>
<li><tt>TQFont::Han</tt> - consists of the CJK (Chinese, Japanese, Korean)
idiographic characters.
<li><tt>TQFont::Hiragana</tt> - is a cursive syllabary used to indicate phonetics
and pronounciation of Japanese words.
<li><tt>TQFont::Katakana</tt> - is a non-cursive syllabic script used to write
Japanese words with visual emphasis and non-Japanese words
in a phonetical manner.
<li><tt>TQFont::Hangul</tt> - is a Korean script consisting of alphabetic components.
<li><tt>TQFont::Bopomofo</tt> - is a phonetic alphabet for Chinese (mainly Mandarin).
<li><tt>TQFont::Yi</tt> - (also called Cuan or Wei) is a syllabary used to write
the Yi language of Southwestern China, Myanmar, Laos, and Vietnam.
</ul><p> Additional scripts that do not fit well into the script categories above:
<ul>
<li><tt>TQFont::Ethiopic</tt> - is a syllabary used by several Central East African languages.
<li><tt>TQFont::Cherokee</tt> - is a left-to-right syllabic script used to write
the Cherokee language.
<li><tt>TQFont::CanadianAboriginal</tt> - consists of the syllabics used by some
Canadian aboriginal societies.
<li><tt>TQFont::Mongolian</tt> - is the traditional (and recently reintroduced)
script used to write Mongolian.
</ul><p> Symbols:
<ul>
<li><tt>TQFont::CurrencySymbols</tt> - contains currency symbols not encoded in other scripts.
<li><tt>TQFont::LetterlikeSymbols</tt> - consists of symbols derived  from
ordinary letters of an alphabetical script.
<li><tt>TQFont::NumberForms</tt> - are provided for compatibility with other
existing character sets.
<li><tt>TQFont::MathematicalOperators</tt> - consists of encodings for operators,
relations and other symbols like arrows used in a mathematical context.
<li><tt>TQFont::TechnicalSymbols</tt> - contains representations for control
codes, the space symbol, APL symbols and other symbols
mainly used in the context of electronic data processing.
<li><tt>TQFont::GeometricSymbols</tt> - covers block elements and geometric shapes.
<li><tt>TQFont::MiscellaneousSymbols</tt> - consists of a heterogeneous collection
of symbols that do not fit any other Unicode character
block, e.g. Dingbats.
<li><tt>TQFont::EnclosedAndSquare</tt> - is provided for compatibility with some
East Asian standards.
<li><tt>TQFont::Braille</tt> - is an international writing system used by blind
people. This script encodes the 256 eight-dot patterns with
the 64 six-dot patterns as a subset.
<li><tt>TQFont::Tagalog</tt>
<li><tt>TQFont::Hanunoo</tt>
<li><tt>TQFont::Buhid</tt>
<li><tt>TQFont::Tagbanwa</tt>
<li><tt>TQFont::KatakanaHalfWidth</tt>
<li><tt>TQFont::Limbu</tt> - (Unicode 4.0)
<li><tt>TQFont::TaiLe</tt> - (Unicode 4.0)
<li><tt>TQFont::Unicode</tt> - includes all the above scripts.
</ul>
<h3 class=fn><a name="Stretch-enum"></a>TQFont::Stretch</h3>

<p> Predefined stretch values that follow the CSS naming convention.
<ul>
<li><tt>TQFont::UltraCondensed</tt> - 50
<li><tt>TQFont::ExtraCondensed</tt> - 62
<li><tt>TQFont::Condensed</tt> - 75
<li><tt>TQFont::SemiCondensed</tt> - 87
<li><tt>TQFont::Unstretched</tt> - 100
<li><tt>TQFont::SemiExpanded</tt> - 112
<li><tt>TQFont::Expanded</tt> - 125
<li><tt>TQFont::ExtraExpanded</tt> - 150
<li><tt>TQFont::UltraExpanded</tt> - 200
</ul><p> <p>See also <a href="#setStretch">setStretch</a>() and <a href="#stretch">stretch</a>().

<h3 class=fn><a name="StyleHint-enum"></a>TQFont::StyleHint</h3>

<p> Style hints are used by the <a href="#fontmatching">font
    matching</a> algorithm to find an appropriate default family
if a selected font family is not available.
<ul>
<li><tt>TQFont::AnyStyle</tt> - leaves the font matching algorithm to choose the
family. This is the default.
<li><tt>TQFont::SansSerif</tt> - the font matcher prefer sans serif fonts.
<li><tt>TQFont::Helvetica</tt> - is a synonym for <a href="#StyleHint-enum">SansSerif</a>.
<li><tt>TQFont::Serif</tt> - the font matcher prefers serif fonts.
<li><tt>TQFont::Times</tt> - is a synonym for <a href="#StyleHint-enum">Serif</a>.
<li><tt>TQFont::TypeWriter</tt> - the font matcher prefers fixed pitch fonts.
<li><tt>TQFont::Courier</tt> - a synonym for <a href="#StyleHint-enum">TypeWriter</a>.
<li><tt>TQFont::OldEnglish</tt> - the font matcher prefers decorative fonts.
<li><tt>TQFont::Decorative</tt> - is a synonym for <a href="#StyleHint-enum">OldEnglish</a>.
<li><tt>TQFont::System</tt> - the font matcher prefers system fonts.
</ul>
<h3 class=fn><a name="StyleStrategy-enum"></a>TQFont::StyleStrategy</h3>

<p> The style strategy tells the <a href="#fontmatching">font
    matching</a> algorithm what type of fonts should be used to
find an appropriate default family.
<p> The following strategies are available:
<ul>
<li><tt>TQFont::PreferDefault</tt> - the default style strategy. It does not prefer
any type of font.
<li><tt>TQFont::PreferBitmap</tt> - prefers bitmap fonts (as opposed to outline
fonts).
<li><tt>TQFont::PreferDevice</tt> - prefers device fonts.
<li><tt>TQFont::PreferOutline</tt> - prefers outline fonts (as opposed to bitmap fonts).
<li><tt>TQFont::ForceOutline</tt> - forces the use of outline fonts.
<li><tt>TQFont::NoAntialias</tt> - don't antialias the fonts.
<li><tt>TQFont::PreferAntialias</tt> - antialias if possible.
<li><tt>TQFont::OpenGLCompatible</tt> - forces the use of OpenGL compatible
fonts.
</ul><p> Any of these may be OR-ed with one of these flags:
<ul>
<li><tt>TQFont::PreferMatch</tt> - prefer an exact match. The font matcher will try to
use the exact font size that has been specified.
<li><tt>TQFont::PreferQuality</tt> - prefer the best quality font. The font matcher
will use the nearest standard point size that the font
supports.
</ul>
<h3 class=fn><a name="Weight-enum"></a>TQFont::Weight</h3>

<p> TQt 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> This enum contains the predefined font weights:
<ul>
<li><tt>TQFont::Light</tt> - 25
<li><tt>TQFont::Normal</tt> - 50
<li><tt>TQFont::DemiBold</tt> - 63
<li><tt>TQFont::Bold</tt> - 75
<li><tt>TQFont::Black</tt> - 87
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQFont"></a>TQFont::TQFont ()
</h3>
Constructs a font object that uses the application's default font.
<p> <p>See also <a href="qapplication.html#setFont">TQApplication::setFont</a>() and <a href="qapplication.html#font">TQApplication::font</a>().

<h3 class=fn><a name="TQFont-2"></a>TQFont::TQFont ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;family, int&nbsp;pointSize = 12, int&nbsp;weight = Normal, bool&nbsp;italic = FALSE )
</h3>
Constructs a font object with the specified <em>family</em>, <em>pointSize</em>, <em>weight</em> and <em>italic</em> settings.
<p> If <em>pointSize</em> is <= 0 it is set to 1.
<p> The <em>family</em> name may optionally also include a foundry name,
e.g. "Helvetica [Cronyx]". (The TQt 2.x syntax, i.e.
"Cronyx-Helvetica", is also supported.) If the <em>family</em> 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="#fontmatching">font
    matching</a> algorithm.
<p> <p>See also <a href="#Weight-enum">Weight</a>, <a href="#setFamily">setFamily</a>(), <a href="#setPointSize">setPointSize</a>(), <a href="#setWeight">setWeight</a>(), <a href="#setItalic">setItalic</a>(), <a href="#setStyleHint">setStyleHint</a>(), and <a href="qapplication.html#font">TQApplication::font</a>().

<h3 class=fn><a name="TQFont-3"></a>TQFont::TQFont ( const&nbsp;<a href="qfont.html">TQFont</a>&nbsp;&amp;&nbsp;font )
</h3>
Constructs a font that is a copy of <em>font</em>.

<h3 class=fn><a name="~TQFont"></a>TQFont::~TQFont ()
</h3>
Destroys the font object and frees all allocated resources.

<h3 class=fn>bool <a name="bold"></a>TQFont::bold () const
</h3>

<p> Returns TRUE if <a href="#weight">weight</a>() is a value greater than <a href="#Weight-enum">TQFont::Normal</a>; otherwise returns FALSE.
<p> <p>See also <a href="#weight">weight</a>(), <a href="#setBold">setBold</a>(), and <a href="qfontinfo.html#bold">TQFontInfo::bold</a>().

<p>Example: <a href="tutorial2-09.html#x2634">chart/optionsform.cpp</a>.
<h3 class=fn>int <a name="deciPointSize"></a>TQFont::deciPointSize () const<tt> [protected]</tt>
</h3>
Returns the point size in 1/10ths of a point.
<p> The returned value will be -1 if the font size has been specified
in pixels.
<p> <p>See also <a href="#pointSize">pointSize</a>() and <a href="#pointSizeFloat">pointSizeFloat</a>().

<h3 class=fn><a href="qstring.html">TQString</a> <a name="defaultFamily"></a>TQFont::defaultFamily () const
</h3>
Returns the family name that corresponds to the current style
hint.
<p> <p>See also <a href="#StyleHint-enum">StyleHint</a>, <a href="#styleHint">styleHint</a>(), and <a href="#setStyleHint">setStyleHint</a>().

<h3 class=fn><a href="qfont.html">TQFont</a> <a name="defaultFont"></a>TQFont::defaultFont ()<tt> [static]</tt>
</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Please use <a href="qapplication.html#font">TQApplication::font</a>() instead.

<h3 class=fn>bool <a name="dirty"></a>TQFont::dirty () const<tt> [protected]</tt>
</h3>
Returns TRUE if the font attributes have been changed and the font
has to be (re)loaded; otherwise returns FALSE.

<h3 class=fn>bool <a name="exactMatch"></a>TQFont::exactMatch () const
</h3>
Returns TRUE if a window system font exactly matching the settings
of this font is available.
<p> <p>See also <a href="qfontinfo.html">TQFontInfo</a>.

<h3 class=fn><a href="qstring.html">TQString</a> <a name="family"></a>TQFont::family () const
</h3>
Returns the requested font family name, i.e. the name set in the
constructor or the last setFont() call.
<p> <p>See also <a href="#setFamily">setFamily</a>(), <a href="#substitutes">substitutes</a>(), and <a href="#substitute">substitute</a>().

<p>Examples: <a href="tutorial2-09.html#x2635">chart/optionsform.cpp</a> and <a href="simple-font-demo-example.html#x2838">fonts/simple-qfont-demo/viewer.cpp</a>.
<h3 class=fn>bool <a name="fixedPitch"></a>TQFont::fixedPitch () const
</h3>
Returns TRUE if fixed pitch has been set; otherwise returns FALSE.
<p> <p>See also <a href="#setFixedPitch">setFixedPitch</a>() and <a href="qfontinfo.html#fixedPitch">TQFontInfo::fixedPitch</a>().

<h3 class=fn>bool <a name="fromString"></a>TQFont::fromString ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;descrip )
</h3>
Sets this font to match the description <em>descrip</em>. The description
is a comma-separated list of the font attributes, as returned by
<a href="#toString">toString</a>().
<p> <p>See also <a href="#toString">toString</a>() and <a href="#operator-gt-gt">operator&gt;&gt;</a>().

<h3 class=fn>HFONT <a name="handle"></a>TQFont::handle () const
</h3>
Returns the window system handle to the font, for low-level
access. Using this function is <em>not</em> portable.

<h3 class=fn>void <a name="insertSubstitution"></a>TQFont::insertSubstitution ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;familyName, const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;substituteName )<tt> [static]</tt>
</h3>
Inserts the family name <em>substituteName</em> into the substitution
table for <em>familyName</em>.
<p> <p>See also <a href="#insertSubstitutions">insertSubstitutions</a>(), <a href="#removeSubstitution">removeSubstitution</a>(), <a href="#substitutions">substitutions</a>(), <a href="#substitute">substitute</a>(), and <a href="#substitutes">substitutes</a>().

<p>Example: <a href="simple-font-demo-example.html#x2839">fonts/simple-qfont-demo/viewer.cpp</a>.
<h3 class=fn>void <a name="insertSubstitutions"></a>TQFont::insertSubstitutions ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;familyName, const&nbsp;<a href="qstringlist.html">TQStringList</a>&nbsp;&amp;&nbsp;substituteNames )<tt> [static]</tt>
</h3>
Inserts the list of families <em>substituteNames</em> into the
substitution list for <em>familyName</em>.
<p> <p>See also <a href="#insertSubstitution">insertSubstitution</a>(), <a href="#removeSubstitution">removeSubstitution</a>(), <a href="#substitutions">substitutions</a>(), and <a href="#substitute">substitute</a>().

<p>Example: <a href="simple-font-demo-example.html#x2840">fonts/simple-qfont-demo/viewer.cpp</a>.
<h3 class=fn>bool <a name="isCopyOf"></a>TQFont::isCopyOf ( const&nbsp;<a href="qfont.html">TQFont</a>&nbsp;&amp;&nbsp;f ) const
</h3>
Returns TRUE if this font and <em>f</em> 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>See also <a href="#operator-eq">operator=</a>() and <a href="#operator-eq-eq">operator==</a>().

<h3 class=fn>bool <a name="italic"></a>TQFont::italic () const
</h3>
Returns TRUE if italic has been set; otherwise returns FALSE.
<p> <p>See also <a href="#setItalic">setItalic</a>().

<p>Example: <a href="tutorial2-09.html#x2636">chart/optionsform.cpp</a>.
<h3 class=fn><a href="qstring.html">TQString</a> <a name="key"></a>TQFont::key () const
</h3>
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>See also <a href="qmap.html">TQMap</a>.

<h3 class=fn><a href="qstring.html">TQString</a> <a name="lastResortFamily"></a>TQFont::lastResortFamily () const
</h3>
Returns the "last resort" font family name.
<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 a null string is returned.
<p> <p>See also <a href="#lastResortFont">lastResortFont</a>().

<h3 class=fn><a href="qstring.html">TQString</a> <a name="lastResortFont"></a>TQFont::lastResortFont () const
</h3>
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> 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> It is theoretically possible that there really isn't a
<a href="#lastResortFont">lastResortFont</a>() in which case TQt 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>See also <a href="#lastResortFamily">lastResortFamily</a>() and <a href="#rawName">rawName</a>().

<h3 class=fn>bool <a name="operator!-eq"></a>TQFont::operator!= ( const&nbsp;<a href="qfont.html">TQFont</a>&nbsp;&amp;&nbsp;f ) const
</h3>
Returns TRUE if this font is different from <em>f</em>; otherwise
returns FALSE.
<p> Two TQFonts are considered to be different if their font attributes
are different. If <a href="#rawMode">rawMode</a>() is enabled for both fonts, only the
family fields are compared.
<p> <p>See also <a href="#operator-eq-eq">operator==</a>().

<h3 class=fn><a href="qfont.html">TQFont</a>&nbsp;&amp; <a name="operator-eq"></a>TQFont::operator= ( const&nbsp;<a href="qfont.html">TQFont</a>&nbsp;&amp;&nbsp;font )
</h3>
Assigns <em>font</em> to this font and returns a reference to it.

<h3 class=fn>bool <a name="operator-eq-eq"></a>TQFont::operator== ( const&nbsp;<a href="qfont.html">TQFont</a>&nbsp;&amp;&nbsp;f ) const
</h3>
Returns TRUE if this font is equal to <em>f</em>; otherwise returns
FALSE.
<p> Two TQFonts are considered equal if their font attributes are
equal. If <a href="#rawMode">rawMode</a>() is enabled for both fonts, only the family
fields are compared.
<p> <p>See also <a href="#operator!-eq">operator!=</a>() and <a href="#isCopyOf">isCopyOf</a>().

<h3 class=fn>bool <a name="overline"></a>TQFont::overline () const
</h3>
Returns TRUE if overline has been set; otherwise returns FALSE.
<p> <p>See also <a href="#setOverline">setOverline</a>().

<h3 class=fn>int <a name="pixelSize"></a>TQFont::pixelSize () const
</h3>
Returns the pixel size of the font if it was set with
<a href="#setPixelSize">setPixelSize</a>(). Returns -1 if the size was set with <a href="#setPointSize">setPointSize</a>()
or <a href="#setPointSizeFloat">setPointSizeFloat</a>().
<p> <p>See also <a href="#setPixelSize">setPixelSize</a>(), <a href="#pointSize">pointSize</a>(), <a href="qfontinfo.html#pointSize">TQFontInfo::pointSize</a>(), and <a href="qfontinfo.html#pixelSize">TQFontInfo::pixelSize</a>().

<h3 class=fn>int <a name="pointSize"></a>TQFont::pointSize () const
</h3>
Returns the point size of the font. Returns -1 if the font size
was specified in pixels.
<p> <p>See also <a href="#setPointSize">setPointSize</a>(), <a href="#deciPointSize">deciPointSize</a>(), and <a href="#pointSizeFloat">pointSizeFloat</a>().

<p>Examples: <a href="tutorial2-09.html#x2637">chart/optionsform.cpp</a> and <a href="simple-font-demo-example.html#x2841">fonts/simple-qfont-demo/viewer.cpp</a>.
<h3 class=fn>float <a name="pointSizeFloat"></a>TQFont::pointSizeFloat () const
</h3>
Returns the point size of the font. Returns -1 if the font size was
specified in pixels.
<p> <p>See also <a href="#pointSize">pointSize</a>(), <a href="#setPointSizeFloat">setPointSizeFloat</a>(), <a href="#pixelSize">pixelSize</a>(), <a href="qfontinfo.html#pointSize">TQFontInfo::pointSize</a>(), and <a href="qfontinfo.html#pixelSize">TQFontInfo::pixelSize</a>().

<h3 class=fn>void <a name="qwsRenderToDisk"></a>TQFont::qwsRenderToDisk ( bool&nbsp;all = TRUE )
</h3>
Saves the glyphs in the font that have previously been accessed as
a TQPF file. If <em>all</em> is TRUE (the default), then before saving,
all glyphs are marked as used.
<p> If the font is large and you are sure that only a subset of
characters will ever be required on the target device, passing
FALSE for the <em>all</em> parameter can save a significant amount of
disk space.
<p> Note that this function is only applicable on TQt/Embedded.

<h3 class=fn>bool <a name="rawMode"></a>TQFont::rawMode () const
</h3>
Returns TRUE if raw mode is used for font name matching; otherwise
returns FALSE.
<p> <p>See also <a href="#setRawMode">setRawMode</a>() and <a href="#rawName">rawName</a>().

<h3 class=fn><a href="qstring.html">TQString</a> <a name="rawName"></a>TQFont::rawName () const
</h3>
Returns the name of the font within the underlying window system.
<p> On Windows, this is usually just the family name of a TrueType
font.
<p> On X11, it is an XLFD (X Logical Font Description).  When TQt is
build with Xft support on X11, the return value can be an Xft
pattern or an XLFD.
<p> Using the return value of this function is usually <em>not</em> <em>portable</em>.
<p> <p>See also <a href="#setRawName">setRawName</a>().

<h3 class=fn>void <a name="removeSubstitution"></a>TQFont::removeSubstitution ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;familyName )<tt> [static]</tt>
</h3>
Removes all the substitutions for <em>familyName</em>.
<p> <p>See also <a href="#insertSubstitutions">insertSubstitutions</a>(), <a href="#insertSubstitution">insertSubstitution</a>(), <a href="#substitutions">substitutions</a>(), and <a href="#substitute">substitute</a>().

<h3 class=fn><a href="qfont.html">TQFont</a> <a name="resolve"></a>TQFont::resolve ( const&nbsp;<a href="qfont.html">TQFont</a>&nbsp;&amp;&nbsp;other ) const
</h3>
Returns a new TQFont that has attributes copied from <em>other</em>.

<h3 class=fn>void <a name="setBold"></a>TQFont::setBold ( bool&nbsp;enable )
</h3>

<p> If <em>enable</em> is true sets the font's weight to <a href="#Weight-enum">TQFont::Bold</a>; otherwise sets the weight to <a href="#Weight-enum">TQFont::Normal</a>.
<p> For finer boldness control use <a href="#setWeight">setWeight</a>().
<p> <p>See also <a href="#bold">bold</a>() and <a href="#setWeight">setWeight</a>().

<p>Examples: <a href="menu-example.html#x1860">menu/menu.cpp</a> and <a href="themes-example.html#x280">themes/metal.cpp</a>.
<h3 class=fn>void <a name="setDefaultFont"></a>TQFont::setDefaultFont ( const&nbsp;<a href="qfont.html">TQFont</a>&nbsp;&amp;&nbsp;f )<tt> [static]</tt>
</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Please use <a href="qapplication.html#setFont">TQApplication::setFont</a>() instead.

<h3 class=fn>void <a name="setFamily"></a>TQFont::setFamily ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;family )
</h3>
Sets the family name of the font. The name is case insensitive and
may include a foundry name.
<p> The <em>family</em> name may optionally also include a foundry name,
e.g. "Helvetica [Cronyx]". (The TQt 2.x syntax, i.e.
"Cronyx-Helvetica", is also supported.) If the <em>family</em> 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="#fontmatching">font
    matching</a> algorithm.
<p> <p>See also <a href="#family">family</a>(), <a href="#setStyleHint">setStyleHint</a>(), and <a href="qfontinfo.html">TQFontInfo</a>.

<h3 class=fn>void <a name="setFixedPitch"></a>TQFont::setFixedPitch ( bool&nbsp;enable )
</h3>
If <em>enable</em> is TRUE, sets fixed pitch on; otherwise sets fixed
pitch off.
<p> <p>See also <a href="#fixedPitch">fixedPitch</a>() and <a href="qfontinfo.html">TQFontInfo</a>.

<h3 class=fn>void <a name="setItalic"></a>TQFont::setItalic ( bool&nbsp;enable )
</h3>
If <em>enable</em> is TRUE, italic is set on; otherwise italic is set
off.
<p> <p>See also <a href="#italic">italic</a>() and <a href="qfontinfo.html">TQFontInfo</a>.

<p>Examples: <a href="fileiconview-example.html#x828">fileiconview/qfileiconview.cpp</a>, <a href="simple-font-demo-example.html#x2842">fonts/simple-qfont-demo/viewer.cpp</a>, and <a href="themes-example.html#x281">themes/metal.cpp</a>.
<h3 class=fn>void <a name="setOverline"></a>TQFont::setOverline ( bool&nbsp;enable )
</h3>
If <em>enable</em> is TRUE, sets overline on; otherwise sets overline off.
<p> <p>See also <a href="#overline">overline</a>() and <a href="qfontinfo.html">TQFontInfo</a>.

<h3 class=fn>void <a name="setPixelSize"></a>TQFont::setPixelSize ( int&nbsp;pixelSize )
</h3>
Sets the font size to <em>pixelSize</em> pixels.
<p> Using this function makes the font device dependent. Use
<a href="#setPointSize">setPointSize</a>() or <a href="#setPointSizeFloat">setPointSizeFloat</a>() to set the size of the font
in a device independent manner.
<p> <p>See also <a href="#pixelSize">pixelSize</a>().

<p>Example: <a href="qwerty-example.html#x367">qwerty/qwerty.cpp</a>.
<h3 class=fn>void <a name="setPixelSizeFloat"></a>TQFont::setPixelSizeFloat ( float&nbsp;pixelSize )
</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Sets the logical pixel height of font characters when shown on
the screen to <em>pixelSize</em>.

<h3 class=fn>void <a name="setPointSize"></a>TQFont::setPointSize ( int&nbsp;pointSize )
</h3>
Sets the point size to <em>pointSize</em>. The point size must be
greater than zero.
<p> <p>See also <a href="#pointSize">pointSize</a>() and <a href="#setPointSizeFloat">setPointSizeFloat</a>().

<p>Example: <a href="simple-font-demo-example.html#x2843">fonts/simple-qfont-demo/viewer.cpp</a>.
<h3 class=fn>void <a name="setPointSizeFloat"></a>TQFont::setPointSizeFloat ( float&nbsp;pointSize )
</h3>
Sets the point size to <em>pointSize</em>. The point size must be
greater than zero. The requested precision may not be achieved on
all platforms.
<p> <p>See also <a href="#pointSizeFloat">pointSizeFloat</a>(), <a href="#setPointSize">setPointSize</a>(), and <a href="#setPixelSize">setPixelSize</a>().

<h3 class=fn>void <a name="setRawMode"></a>TQFont::setRawMode ( bool&nbsp;enable )
</h3>
If <em>enable</em> is TRUE, turns raw mode on; otherwise turns raw mode
off. This function only has an effect under X11.
<p> If raw mode is enabled, TQt will search for an X font with a
complete font name matching the family name, ignoring all other
values set for the TQFont. If the font name matches several fonts,
TQt will use the first font returned by X. <a href="qfontinfo.html">TQFontInfo</a> <em>cannot</em> be
used to fetch information about a TQFont using raw mode (it will
return the values set in the TQFont for all parameters, including
the family name).
<p> <b>Warning:</b> Do not use raw mode unless you really, really need it! In
most (if not all) cases, <a href="#setRawName">setRawName</a>() is a much better choice.
<p> <p>See also <a href="#rawMode">rawMode</a>() and <a href="#setRawName">setRawName</a>().

<h3 class=fn>void <a name="setRawName"></a>TQFont::setRawName ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;name )
</h3>
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 <em>name</em> to this
function.
<p> A font set with <a href="#setRawName">setRawName</a>() is still a full-featured TQFont. It can
be queried (for example with <a href="#italic">italic</a>()) or modified (for example with
<a href="#setItalic">setItalic</a>()) and is therefore also suitable for rendering rich text.
<p> If TQt's internal font database cannot resolve the raw name, the
font becomes a raw font with <em>name</em> as its family.
<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>See also <a href="#rawName">rawName</a>(), <a href="#setRawMode">setRawMode</a>(), and <a href="#setFamily">setFamily</a>().

<h3 class=fn>void <a name="setStretch"></a>TQFont::setStretch ( int&nbsp;factor )
</h3>
Sets the <a href="layout.html#stretch-factor">stretch factor</a> for the font.
<p> The stretch factor changes the width of all characters in the font
by <em>factor</em> percent.  For example, setting <em>factor</em> 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> The stretch factor is only applied to outline fonts.  The stretch
factor is ignored for bitmap fonts.
<p> NOTE: TQFont 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>See also <a href="#stretch">stretch</a>() and <a href="#StyleStrategy-enum">TQFont::StyleStrategy</a>.

<h3 class=fn>void <a name="setStrikeOut"></a>TQFont::setStrikeOut ( bool&nbsp;enable )
</h3>
If <em>enable</em> is TRUE, sets strikeout on; otherwise sets strikeout
off.
<p> <p>See also <a href="#strikeOut">strikeOut</a>() and <a href="qfontinfo.html">TQFontInfo</a>.

<h3 class=fn>void <a name="setStyleHint"></a>TQFont::setStyleHint ( <a href="qfont.html#StyleHint-enum">StyleHint</a>&nbsp;hint, <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a>&nbsp;strategy = PreferDefault )
</h3>
Sets the style hint and strategy to <em>hint</em> and <em>strategy</em>,
respectively.
<p> If these aren't set explicitly the style hint will default to
<a href="#StyleHint-enum">AnyStyle</a> and the style strategy to <a href="#StyleStrategy-enum">PreferDefault</a>.
<p> TQt does not support style hints on X11 since this information
is not provided by the window system.
<p> <p>See also <a href="#StyleHint-enum">StyleHint</a>, <a href="#styleHint">styleHint</a>(), <a href="#StyleStrategy-enum">StyleStrategy</a>, <a href="#styleStrategy">styleStrategy</a>(), and <a href="qfontinfo.html">TQFontInfo</a>.

<p>Examples: <a href="desktop-example.html#x1728">desktop/desktop.cpp</a> and <a href="simple-font-demo-example.html#x2844">fonts/simple-qfont-demo/viewer.cpp</a>.
<h3 class=fn>void <a name="setStyleStrategy"></a>TQFont::setStyleStrategy ( <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a>&nbsp;s )
</h3>
Sets the style strategy for the font to <em>s</em>.
<p> <p>See also <a href="#StyleStrategy-enum">TQFont::StyleStrategy</a>.

<h3 class=fn>void <a name="setUnderline"></a>TQFont::setUnderline ( bool&nbsp;enable )
</h3>
If <em>enable</em> is TRUE, sets underline on; otherwise sets underline
off.
<p> <p>See also <a href="#underline">underline</a>() and <a href="qfontinfo.html">TQFontInfo</a>.

<p>Examples: <a href="simple-font-demo-example.html#x2845">fonts/simple-qfont-demo/viewer.cpp</a> and <a href="menu-example.html#x1861">menu/menu.cpp</a>.
<h3 class=fn>void <a name="setWeight"></a>TQFont::setWeight ( int&nbsp;weight )
</h3>
Sets the weight the font to <em>weight</em>, which should be a value
from the <a href="#Weight-enum">TQFont::Weight</a> enumeration.
<p> <p>See also <a href="#weight">weight</a>() and <a href="qfontinfo.html">TQFontInfo</a>.

<p>Example: <a href="simple-font-demo-example.html#x2846">fonts/simple-qfont-demo/viewer.cpp</a>.
<h3 class=fn>int <a name="stretch"></a>TQFont::stretch () const
</h3>
Returns the <a href="layout.html#stretch-factor">stretch factor</a> for the font.
<p> <p>See also <a href="#setStretch">setStretch</a>().

<h3 class=fn>bool <a name="strikeOut"></a>TQFont::strikeOut () const
</h3>
Returns TRUE if strikeout has been set; otherwise returns FALSE.
<p> <p>See also <a href="#setStrikeOut">setStrikeOut</a>().

<h3 class=fn><a href="qfont.html#StyleHint-enum">StyleHint</a> <a name="styleHint"></a>TQFont::styleHint () const
</h3>
Returns the StyleHint.
<p> The style hint affects the <a href="#fontmatching">font
    matching</a> algorithm. See <a href="#StyleHint-enum">TQFont::StyleHint</a> for the list
of strategies.
<p> <p>See also <a href="#setStyleHint">setStyleHint</a>(), <a href="#StyleStrategy-enum">TQFont::StyleStrategy</a>, and <a href="qfontinfo.html#styleHint">TQFontInfo::styleHint</a>().

<h3 class=fn><a href="qfont.html#StyleStrategy-enum">StyleStrategy</a> <a name="styleStrategy"></a>TQFont::styleStrategy () const
</h3>
Returns the StyleStrategy.
<p> The style strategy affects the <a href="#fontmatching">font
    matching</a> algorithm. See <a href="#StyleStrategy-enum">TQFont::StyleStrategy</a> for the
list of strategies.
<p> <p>See also <a href="#setStyleHint">setStyleHint</a>() and <a href="#StyleHint-enum">TQFont::StyleHint</a>.

<h3 class=fn><a href="qstring.html">TQString</a> <a name="substitute"></a>TQFont::substitute ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;familyName )<tt> [static]</tt>
</h3>
Returns the first family name to be used whenever <em>familyName</em> is
specified. The lookup is case insensitive.
<p> If there is no substitution for <em>familyName</em>, <em>familyName</em> is
returned.
<p> To obtain a list of substitutions use <a href="#substitutes">substitutes</a>().
<p> <p>See also <a href="#setFamily">setFamily</a>(), <a href="#insertSubstitutions">insertSubstitutions</a>(), <a href="#insertSubstitution">insertSubstitution</a>(), and <a href="#removeSubstitution">removeSubstitution</a>().

<h3 class=fn><a href="qstringlist.html">TQStringList</a> <a name="substitutes"></a>TQFont::substitutes ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;familyName )<tt> [static]</tt>
</h3>
Returns a list of family names to be used whenever <em>familyName</em>
is specified. The lookup is case insensitive.
<p> If there is no substitution for <em>familyName</em>, an empty list is
returned.
<p> <p>See also <a href="#substitute">substitute</a>(), <a href="#insertSubstitutions">insertSubstitutions</a>(), <a href="#insertSubstitution">insertSubstitution</a>(), and <a href="#removeSubstitution">removeSubstitution</a>().

<p>Example: <a href="simple-font-demo-example.html#x2847">fonts/simple-qfont-demo/viewer.cpp</a>.
<h3 class=fn><a href="qstringlist.html">TQStringList</a> <a name="substitutions"></a>TQFont::substitutions ()<tt> [static]</tt>
</h3>
Returns a sorted list of substituted family names.
<p> <p>See also <a href="#insertSubstitution">insertSubstitution</a>(), <a href="#removeSubstitution">removeSubstitution</a>(), and <a href="#substitute">substitute</a>().

<h3 class=fn><a href="qstring.html">TQString</a> <a name="toString"></a>TQFont::toString () const
</h3>
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">TQSettings</a>.
<p> <p>See also <a href="#fromString">fromString</a>() and <a href="#operator-lt-lt">operator&lt;&lt;</a>().

<h3 class=fn>bool <a name="underline"></a>TQFont::underline () const
</h3>
Returns TRUE if underline has been set; otherwise returns FALSE.
<p> <p>See also <a href="#setUnderline">setUnderline</a>().

<h3 class=fn>int <a name="weight"></a>TQFont::weight () const
</h3>
Returns the weight of the font which is one of the enumerated
values from <a href="#Weight-enum">TQFont::Weight</a>.
<p> <p>See also <a href="#setWeight">setWeight</a>(), <a href="#Weight-enum">Weight</a>, and <a href="qfontinfo.html">TQFontInfo</a>.

<hr><h2>Related Functions</h2>
<h3 class=fn><a href="qdatastream.html">TQDataStream</a>&nbsp;&amp; <a name="operator-lt-lt"></a>operator&lt;&lt; ( <a href="qdatastream.html">TQDataStream</a>&nbsp;&amp;&nbsp;s, const&nbsp;<a href="qfont.html">TQFont</a>&nbsp;&amp;&nbsp;font )
</h3>

<p> Writes the font <em>font</em> to the data stream <em>s</em>. (<a href="#toString">toString</a>()
writes to a text stream.)
<p> <p>See also <a href="datastreamformat.html">Format of the TQDataStream operators</a>.

<h3 class=fn><a href="qdatastream.html">TQDataStream</a>&nbsp;&amp; <a name="operator-gt-gt"></a>operator&gt;&gt; ( <a href="qdatastream.html">TQDataStream</a>&nbsp;&amp;&nbsp;s, <a href="qfont.html">TQFont</a>&nbsp;&amp;&nbsp;font )
</h3>

<p> Reads the font <em>font</em> from the data stream <em>s</em>. (<a href="#fromString">fromString</a>()
reads from a text stream.)
<p> <p>See also <a href="datastreamformat.html">Format of the TQDataStream operators</a>.

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>