Debian Codegraph @

docs/reference/ft2-lcd_rendering.html

raw symbols SCIP
1
2 <!doctype html>
3 <html lang="en" class="no-js">
4 <head>
5
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width,initial-scale=1">
8
9 <meta name="description" content="API Reference Documentation for FreeType-2.14.3">
10
11
12 <meta name="author" content="FreeType Contributors">
13
14
15 <link rel="canonical" href="http://freetype.org/freetype2/docs/reference/ft2-lcd_rendering.html">
16
17
18 <link rel="prev" href="ft2-parameter_tags.html">
19
20
21 <link rel="next" href="ft2-cache_subsystem.html">
22
23
24 <link rel="icon" href="images/favico.ico">
25 <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.9">
26
27
28
29 <title>Subpixel Rendering - FreeType-2.14.3 API Reference</title>
30
31
32
33 <link rel="stylesheet" href="assets/stylesheets/main.4af4bdda.min.css">
34
35
36 <link rel="stylesheet" href="assets/stylesheets/palette.06af60db.min.css">
37
38
39
40
41
42
43
44
45
46
47
48
49 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
50 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
51 <style>:root{--md-text-font:"Noto Serif";--md-code-font:"Roboto Mono"}</style>
52
53
54
55 <link rel="stylesheet" href="stylesheets/extra.css">
56
57 <script>__md_scope=new URL(".",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
58
59
60
61
62
63
64 </head>
65
66
67
68
69
70
71
72 <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="green" data-md-color-accent="green">
73
74
75 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
76 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
77 <label class="md-overlay" for="__drawer"></label>
78 <div data-md-component="skip">
79
80
81 <a href="#subpixel-rendering" class="md-skip">
82 Skip to content
83 </a>
84
85 </div>
86 <div data-md-component="announce">
87
88 </div>
89
90
91
92
93
94
95 <header class="md-header md-header--shadow" data-md-component="header">
96 <nav class="md-header__inner md-grid" aria-label="Header">
97 <a href="index.html" title="FreeType-2.14.3 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.14.3 API Reference" data-md-component="logo">
98
99 <img src="images/favico.ico" alt="logo">
100
101 </a>
102 <label class="md-header__button md-icon" for="__drawer">
103
104 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
105 </label>
106 <div class="md-header__title" data-md-component="header-title">
107 <div class="md-header__ellipsis">
108 <div class="md-header__topic">
109 <span class="md-ellipsis">
110 FreeType-2.14.3 API Reference
111 </span>
112 </div>
113 <div class="md-header__topic" data-md-component="header-topic">
114 <span class="md-ellipsis">
115
116 Subpixel Rendering
117
118 </span>
119 </div>
120 </div>
121 </div>
122
123
124
125
126
127
128 <label class="md-header__button md-icon" for="__search">
129
130 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
131 </label>
132 <div class="md-search" data-md-component="search" role="dialog">
133 <label class="md-search__overlay" for="__search"></label>
134 <div class="md-search__inner" role="search">
135 <form class="md-search__form" name="search">
136 <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
137 <label class="md-search__icon md-icon" for="__search">
138
139 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
140
141 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
142 </label>
143 <nav class="md-search__options" aria-label="Search">
144
145 <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
146
147 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
148 </button>
149 </nav>
150
151 </form>
152 <div class="md-search__output">
153 <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
154 <div class="md-search-result" data-md-component="search-result">
155 <div class="md-search-result__meta">
156 Initializing search
157 </div>
158 <ol class="md-search-result__list" role="presentation"></ol>
159 </div>
160 </div>
161 </div>
162 </div>
163 </div>
164
165
166 </nav>
167
168 </header>
169
170 <div class="md-container" data-md-component="container">
171
172
173
174
175
176
177 <main class="md-main" data-md-component="main">
178 <div class="md-main__inner md-grid">
179
180
181
182 <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
183 <div class="md-sidebar__scrollwrap">
184 <div class="md-sidebar__inner">
185
186
187
188
189 <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
190 <label class="md-nav__title" for="__drawer">
191 <a href="index.html" title="FreeType-2.14.3 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.14.3 API Reference" data-md-component="logo">
192
193 <img src="images/favico.ico" alt="logo">
194
195 </a>
196 FreeType-2.14.3 API Reference
197 </label>
198
199 <ul class="md-nav__list" data-md-scrollfix>
200
201
202
203
204
205
206
207 <li class="md-nav__item">
208 <a href="index.html" class="md-nav__link">
209
210
211 <span class="md-ellipsis">
212 TOC
213
214 </span>
215
216
217 </a>
218 </li>
219
220
221
222
223
224
225
226
227
228 <li class="md-nav__item">
229 <a href="ft2-index.html" class="md-nav__link">
230
231
232 <span class="md-ellipsis">
233 Index
234
235 </span>
236
237
238 </a>
239 </li>
240
241
242
243
244
245
246
247
248
249
250
251
252
253 <li class="md-nav__item md-nav__item--nested">
254
255
256
257 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
258
259
260 <label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0">
261
262
263 <span class="md-ellipsis">
264 General Remarks
265
266 </span>
267
268
269 <span class="md-nav__icon md-icon"></span>
270 </label>
271
272 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
273 <label class="md-nav__title" for="__nav_3">
274 <span class="md-nav__icon md-icon"></span>
275 General Remarks
276 </label>
277 <ul class="md-nav__list" data-md-scrollfix>
278
279
280
281
282
283
284
285 <li class="md-nav__item">
286 <a href="ft2-preamble.html" class="md-nav__link">
287
288
289 <span class="md-ellipsis">
290 Preamble
291
292 </span>
293
294
295 </a>
296 </li>
297
298
299
300
301
302
303
304
305
306
307 <li class="md-nav__item">
308 <a href="ft2-header_inclusion.html" class="md-nav__link">
309
310
311 <span class="md-ellipsis">
312 FreeType's header inclusion scheme
313
314 </span>
315
316
317 </a>
318 </li>
319
320
321
322
323
324
325
326
327
328
329 <li class="md-nav__item">
330 <a href="ft2-user_allocation.html" class="md-nav__link">
331
332
333 <span class="md-ellipsis">
334 User allocation
335
336 </span>
337
338
339 </a>
340 </li>
341
342
343
344
345 </ul>
346 </nav>
347
348 </li>
349
350
351
352
353
354
355
356
357
358
359
360
361
362 <li class="md-nav__item md-nav__item--nested">
363
364
365
366 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
367
368
369 <label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
370
371
372 <span class="md-ellipsis">
373 Core API
374
375 </span>
376
377
378 <span class="md-nav__icon md-icon"></span>
379 </label>
380
381 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
382 <label class="md-nav__title" for="__nav_4">
383 <span class="md-nav__icon md-icon"></span>
384 Core API
385 </label>
386 <ul class="md-nav__list" data-md-scrollfix>
387
388
389
390
391
392
393
394 <li class="md-nav__item">
395 <a href="ft2-basic_types.html" class="md-nav__link">
396
397
398 <span class="md-ellipsis">
399 Basic Data Types
400
401 </span>
402
403
404 </a>
405 </li>
406
407
408
409
410
411
412
413
414
415
416 <li class="md-nav__item">
417 <a href="ft2-library_setup.html" class="md-nav__link">
418
419
420 <span class="md-ellipsis">
421 Library Setup
422
423 </span>
424
425
426 </a>
427 </li>
428
429
430
431
432
433
434
435
436
437
438 <li class="md-nav__item">
439 <a href="ft2-face_creation.html" class="md-nav__link">
440
441
442 <span class="md-ellipsis">
443 Face Creation
444
445 </span>
446
447
448 </a>
449 </li>
450
451
452
453
454
455
456
457
458
459
460 <li class="md-nav__item">
461 <a href="ft2-font_testing_macros.html" class="md-nav__link">
462
463
464 <span class="md-ellipsis">
465 Font Testing Macros
466
467 </span>
468
469
470 </a>
471 </li>
472
473
474
475
476
477
478
479
480
481
482 <li class="md-nav__item">
483 <a href="ft2-sizing_and_scaling.html" class="md-nav__link">
484
485
486 <span class="md-ellipsis">
487 Sizing and Scaling
488
489 </span>
490
491
492 </a>
493 </li>
494
495
496
497
498
499
500
501
502
503
504 <li class="md-nav__item">
505 <a href="ft2-glyph_retrieval.html" class="md-nav__link">
506
507
508 <span class="md-ellipsis">
509 Glyph Retrieval
510
511 </span>
512
513
514 </a>
515 </li>
516
517
518
519
520
521
522
523
524
525
526 <li class="md-nav__item">
527 <a href="ft2-character_mapping.html" class="md-nav__link">
528
529
530 <span class="md-ellipsis">
531 Character Mapping
532
533 </span>
534
535
536 </a>
537 </li>
538
539
540
541
542
543
544
545
546
547
548 <li class="md-nav__item">
549 <a href="ft2-information_retrieval.html" class="md-nav__link">
550
551
552 <span class="md-ellipsis">
553 Information Retrieval
554
555 </span>
556
557
558 </a>
559 </li>
560
561
562
563
564
565
566
567
568
569
570 <li class="md-nav__item">
571 <a href="ft2-other_api_data.html" class="md-nav__link">
572
573
574 <span class="md-ellipsis">
575 Other API Data
576
577 </span>
578
579
580 </a>
581 </li>
582
583
584
585
586 </ul>
587 </nav>
588
589 </li>
590
591
592
593
594
595
596
597
598
599
600
601
602
603 <li class="md-nav__item md-nav__item--nested">
604
605
606
607 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
608
609
610 <label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
611
612
613 <span class="md-ellipsis">
614 Extended API
615
616 </span>
617
618
619 <span class="md-nav__icon md-icon"></span>
620 </label>
621
622 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
623 <label class="md-nav__title" for="__nav_5">
624 <span class="md-nav__icon md-icon"></span>
625 Extended API
626 </label>
627 <ul class="md-nav__list" data-md-scrollfix>
628
629
630
631
632
633
634
635 <li class="md-nav__item">
636 <a href="ft2-glyph_variants.html" class="md-nav__link">
637
638
639 <span class="md-ellipsis">
640 Unicode Variation Sequences
641
642 </span>
643
644
645 </a>
646 </li>
647
648
649
650
651
652
653
654
655
656
657 <li class="md-nav__item">
658 <a href="ft2-color_management.html" class="md-nav__link">
659
660
661 <span class="md-ellipsis">
662 Glyph Color Management
663
664 </span>
665
666
667 </a>
668 </li>
669
670
671
672
673
674
675
676
677
678
679 <li class="md-nav__item">
680 <a href="ft2-layer_management.html" class="md-nav__link">
681
682
683 <span class="md-ellipsis">
684 Glyph Layer Management
685
686 </span>
687
688
689 </a>
690 </li>
691
692
693
694
695
696
697
698
699
700
701 <li class="md-nav__item">
702 <a href="ft2-glyph_management.html" class="md-nav__link">
703
704
705 <span class="md-ellipsis">
706 Glyph Management
707
708 </span>
709
710
711 </a>
712 </li>
713
714
715
716
717
718
719
720
721
722
723 <li class="md-nav__item">
724 <a href="ft2-mac_specific.html" class="md-nav__link">
725
726
727 <span class="md-ellipsis">
728 Mac Specific Interface
729
730 </span>
731
732
733 </a>
734 </li>
735
736
737
738
739
740
741
742
743
744
745 <li class="md-nav__item">
746 <a href="ft2-sizes_management.html" class="md-nav__link">
747
748
749 <span class="md-ellipsis">
750 Size Management
751
752 </span>
753
754
755 </a>
756 </li>
757
758
759
760
761
762
763
764
765
766
767 <li class="md-nav__item">
768 <a href="ft2-header_file_macros.html" class="md-nav__link">
769
770
771 <span class="md-ellipsis">
772 Header File Macros
773
774 </span>
775
776
777 </a>
778 </li>
779
780
781
782
783 </ul>
784 </nav>
785
786 </li>
787
788
789
790
791
792
793
794
795
796
797
798
799
800 <li class="md-nav__item md-nav__item--nested">
801
802
803
804 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
805
806
807 <label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
808
809
810 <span class="md-ellipsis">
811 Format-Specific API
812
813 </span>
814
815
816 <span class="md-nav__icon md-icon"></span>
817 </label>
818
819 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
820 <label class="md-nav__title" for="__nav_6">
821 <span class="md-nav__icon md-icon"></span>
822 Format-Specific API
823 </label>
824 <ul class="md-nav__list" data-md-scrollfix>
825
826
827
828
829
830
831
832 <li class="md-nav__item">
833 <a href="ft2-multiple_masters.html" class="md-nav__link">
834
835
836 <span class="md-ellipsis">
837 OpenType Font Variations, TrueType GX, and Adobe MM Fonts
838
839 </span>
840
841
842 </a>
843 </li>
844
845
846
847
848
849
850
851
852
853
854 <li class="md-nav__item">
855 <a href="ft2-truetype_tables.html" class="md-nav__link">
856
857
858 <span class="md-ellipsis">
859 TrueType Tables
860
861 </span>
862
863
864 </a>
865 </li>
866
867
868
869
870
871
872
873
874
875
876 <li class="md-nav__item">
877 <a href="ft2-type1_tables.html" class="md-nav__link">
878
879
880 <span class="md-ellipsis">
881 Type 1 Tables
882
883 </span>
884
885
886 </a>
887 </li>
888
889
890
891
892
893
894
895
896
897
898 <li class="md-nav__item">
899 <a href="ft2-sfnt_names.html" class="md-nav__link">
900
901
902 <span class="md-ellipsis">
903 SFNT Names
904
905 </span>
906
907
908 </a>
909 </li>
910
911
912
913
914
915
916
917
918
919
920 <li class="md-nav__item">
921 <a href="ft2-bdf_fonts.html" class="md-nav__link">
922
923
924 <span class="md-ellipsis">
925 BDF and PCF Files
926
927 </span>
928
929
930 </a>
931 </li>
932
933
934
935
936
937
938
939
940
941
942 <li class="md-nav__item">
943 <a href="ft2-cid_fonts.html" class="md-nav__link">
944
945
946 <span class="md-ellipsis">
947 CID Fonts
948
949 </span>
950
951
952 </a>
953 </li>
954
955
956
957
958
959
960
961
962
963
964 <li class="md-nav__item">
965 <a href="ft2-pfr_fonts.html" class="md-nav__link">
966
967
968 <span class="md-ellipsis">
969 PFR Fonts
970
971 </span>
972
973
974 </a>
975 </li>
976
977
978
979
980
981
982
983
984
985
986 <li class="md-nav__item">
987 <a href="ft2-winfnt_fonts.html" class="md-nav__link">
988
989
990 <span class="md-ellipsis">
991 Window FNT Files
992
993 </span>
994
995
996 </a>
997 </li>
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008 <li class="md-nav__item">
1009 <a href="ft2-svg_fonts.html" class="md-nav__link">
1010
1011
1012 <span class="md-ellipsis">
1013 OpenType SVG Fonts
1014
1015 </span>
1016
1017
1018 </a>
1019 </li>
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030 <li class="md-nav__item">
1031 <a href="ft2-font_formats.html" class="md-nav__link">
1032
1033
1034 <span class="md-ellipsis">
1035 Font Formats
1036
1037 </span>
1038
1039
1040 </a>
1041 </li>
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052 <li class="md-nav__item">
1053 <a href="ft2-gasp_table.html" class="md-nav__link">
1054
1055
1056 <span class="md-ellipsis">
1057 Gasp Table
1058
1059 </span>
1060
1061
1062 </a>
1063 </li>
1064
1065
1066
1067
1068 </ul>
1069 </nav>
1070
1071 </li>
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
1088
1089
1090
1091 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" checked>
1092
1093
1094 <label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
1095
1096
1097 <span class="md-ellipsis">
1098 Controlling FreeType Modules
1099
1100 </span>
1101
1102
1103 <span class="md-nav__icon md-icon"></span>
1104 </label>
1105
1106 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="true">
1107 <label class="md-nav__title" for="__nav_7">
1108 <span class="md-nav__icon md-icon"></span>
1109 Controlling FreeType Modules
1110 </label>
1111 <ul class="md-nav__list" data-md-scrollfix>
1112
1113
1114
1115
1116
1117
1118
1119 <li class="md-nav__item">
1120 <a href="ft2-auto_hinter.html" class="md-nav__link">
1121
1122
1123 <span class="md-ellipsis">
1124 The auto-hinter
1125
1126 </span>
1127
1128
1129 </a>
1130 </li>
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141 <li class="md-nav__item">
1142 <a href="ft2-cff_driver.html" class="md-nav__link">
1143
1144
1145 <span class="md-ellipsis">
1146 The CFF driver
1147
1148 </span>
1149
1150
1151 </a>
1152 </li>
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163 <li class="md-nav__item">
1164 <a href="ft2-t1_cid_driver.html" class="md-nav__link">
1165
1166
1167 <span class="md-ellipsis">
1168 The Type 1 and CID drivers
1169
1170 </span>
1171
1172
1173 </a>
1174 </li>
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185 <li class="md-nav__item">
1186 <a href="ft2-tt_driver.html" class="md-nav__link">
1187
1188
1189 <span class="md-ellipsis">
1190 The TrueType driver
1191
1192 </span>
1193
1194
1195 </a>
1196 </li>
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207 <li class="md-nav__item">
1208 <a href="ft2-pcf_driver.html" class="md-nav__link">
1209
1210
1211 <span class="md-ellipsis">
1212 The PCF driver
1213
1214 </span>
1215
1216
1217 </a>
1218 </li>
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229 <li class="md-nav__item">
1230 <a href="ft2-ot_svg_driver.html" class="md-nav__link">
1231
1232
1233 <span class="md-ellipsis">
1234 The SVG driver
1235
1236 </span>
1237
1238
1239 </a>
1240 </li>
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251 <li class="md-nav__item">
1252 <a href="ft2-properties.html" class="md-nav__link">
1253
1254
1255 <span class="md-ellipsis">
1256 Driver properties
1257
1258 </span>
1259
1260
1261 </a>
1262 </li>
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273 <li class="md-nav__item">
1274 <a href="ft2-parameter_tags.html" class="md-nav__link">
1275
1276
1277 <span class="md-ellipsis">
1278 Parameter Tags
1279
1280 </span>
1281
1282
1283 </a>
1284 </li>
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297 <li class="md-nav__item md-nav__item--active">
1298
1299 <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
1300
1301
1302
1303
1304
1305 <label class="md-nav__link md-nav__link--active" for="__toc">
1306
1307
1308 <span class="md-ellipsis">
1309 Subpixel Rendering
1310
1311 </span>
1312
1313
1314 <span class="md-nav__icon md-icon"></span>
1315 </label>
1316
1317 <a href="ft2-lcd_rendering.html" class="md-nav__link md-nav__link--active">
1318
1319
1320 <span class="md-ellipsis">
1321 Subpixel Rendering
1322
1323 </span>
1324
1325
1326 </a>
1327
1328
1329
1330 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
1331
1332
1333
1334
1335
1336
1337 <label class="md-nav__title" for="__toc">
1338 <span class="md-nav__icon md-icon"></span>
1339 Table of contents
1340 </label>
1341 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
1342
1343 <li class="md-nav__item">
1344 <a href="#synopsis" class="md-nav__link">
1345 <span class="md-ellipsis">
1346 Synopsis
1347 </span>
1348 </a>
1349
1350 </li>
1351
1352 <li class="md-nav__item">
1353 <a href="#ft_lcdfilter" class="md-nav__link">
1354 <span class="md-ellipsis">
1355 FT_LcdFilter
1356 </span>
1357 </a>
1358
1359 </li>
1360
1361 <li class="md-nav__item">
1362 <a href="#ft_library_setlcdfilter" class="md-nav__link">
1363 <span class="md-ellipsis">
1364 FT_Library_SetLcdFilter
1365 </span>
1366 </a>
1367
1368 </li>
1369
1370 <li class="md-nav__item">
1371 <a href="#ft_library_setlcdfilterweights" class="md-nav__link">
1372 <span class="md-ellipsis">
1373 FT_Library_SetLcdFilterWeights
1374 </span>
1375 </a>
1376
1377 </li>
1378
1379 <li class="md-nav__item">
1380 <a href="#ft_lcdfivetapfilter" class="md-nav__link">
1381 <span class="md-ellipsis">
1382 FT_LcdFiveTapFilter
1383 </span>
1384 </a>
1385
1386 </li>
1387
1388 <li class="md-nav__item">
1389 <a href="#ft_library_setlcdgeometry" class="md-nav__link">
1390 <span class="md-ellipsis">
1391 FT_Library_SetLcdGeometry
1392 </span>
1393 </a>
1394
1395 </li>
1396
1397 </ul>
1398
1399 </nav>
1400
1401 </li>
1402
1403
1404
1405
1406 </ul>
1407 </nav>
1408
1409 </li>
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423 <li class="md-nav__item md-nav__item--nested">
1424
1425
1426
1427 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
1428
1429
1430 <label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
1431
1432
1433 <span class="md-ellipsis">
1434 Cache Sub-System
1435
1436 </span>
1437
1438
1439 <span class="md-nav__icon md-icon"></span>
1440 </label>
1441
1442 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
1443 <label class="md-nav__title" for="__nav_8">
1444 <span class="md-nav__icon md-icon"></span>
1445 Cache Sub-System
1446 </label>
1447 <ul class="md-nav__list" data-md-scrollfix>
1448
1449
1450
1451
1452
1453
1454
1455 <li class="md-nav__item">
1456 <a href="ft2-cache_subsystem.html" class="md-nav__link">
1457
1458
1459 <span class="md-ellipsis">
1460 Cache Sub-System
1461
1462 </span>
1463
1464
1465 </a>
1466 </li>
1467
1468
1469
1470
1471 </ul>
1472 </nav>
1473
1474 </li>
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488 <li class="md-nav__item md-nav__item--nested">
1489
1490
1491
1492 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" >
1493
1494
1495 <label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="0">
1496
1497
1498 <span class="md-ellipsis">
1499 Support API
1500
1501 </span>
1502
1503
1504 <span class="md-nav__icon md-icon"></span>
1505 </label>
1506
1507 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
1508 <label class="md-nav__title" for="__nav_9">
1509 <span class="md-nav__icon md-icon"></span>
1510 Support API
1511 </label>
1512 <ul class="md-nav__list" data-md-scrollfix>
1513
1514
1515
1516
1517
1518
1519
1520 <li class="md-nav__item">
1521 <a href="ft2-computations.html" class="md-nav__link">
1522
1523
1524 <span class="md-ellipsis">
1525 Computations
1526
1527 </span>
1528
1529
1530 </a>
1531 </li>
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542 <li class="md-nav__item">
1543 <a href="ft2-list_processing.html" class="md-nav__link">
1544
1545
1546 <span class="md-ellipsis">
1547 List Processing
1548
1549 </span>
1550
1551
1552 </a>
1553 </li>
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564 <li class="md-nav__item">
1565 <a href="ft2-outline_processing.html" class="md-nav__link">
1566
1567
1568 <span class="md-ellipsis">
1569 Outline Processing
1570
1571 </span>
1572
1573
1574 </a>
1575 </li>
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586 <li class="md-nav__item">
1587 <a href="ft2-quick_advance.html" class="md-nav__link">
1588
1589
1590 <span class="md-ellipsis">
1591 Quick retrieval of advance values
1592
1593 </span>
1594
1595
1596 </a>
1597 </li>
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608 <li class="md-nav__item">
1609 <a href="ft2-bitmap_handling.html" class="md-nav__link">
1610
1611
1612 <span class="md-ellipsis">
1613 Bitmap Handling
1614
1615 </span>
1616
1617
1618 </a>
1619 </li>
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630 <li class="md-nav__item">
1631 <a href="ft2-raster.html" class="md-nav__link">
1632
1633
1634 <span class="md-ellipsis">
1635 Scanline Converter
1636
1637 </span>
1638
1639
1640 </a>
1641 </li>
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652 <li class="md-nav__item">
1653 <a href="ft2-glyph_stroker.html" class="md-nav__link">
1654
1655
1656 <span class="md-ellipsis">
1657 Glyph Stroker
1658
1659 </span>
1660
1661
1662 </a>
1663 </li>
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674 <li class="md-nav__item">
1675 <a href="ft2-system_interface.html" class="md-nav__link">
1676
1677
1678 <span class="md-ellipsis">
1679 System Interface
1680
1681 </span>
1682
1683
1684 </a>
1685 </li>
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696 <li class="md-nav__item">
1697 <a href="ft2-module_management.html" class="md-nav__link">
1698
1699
1700 <span class="md-ellipsis">
1701 Module Management
1702
1703 </span>
1704
1705
1706 </a>
1707 </li>
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718 <li class="md-nav__item">
1719 <a href="ft2-gzip.html" class="md-nav__link">
1720
1721
1722 <span class="md-ellipsis">
1723 GZIP Streams
1724
1725 </span>
1726
1727
1728 </a>
1729 </li>
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740 <li class="md-nav__item">
1741 <a href="ft2-lzw.html" class="md-nav__link">
1742
1743
1744 <span class="md-ellipsis">
1745 LZW Streams
1746
1747 </span>
1748
1749
1750 </a>
1751 </li>
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762 <li class="md-nav__item">
1763 <a href="ft2-bzip2.html" class="md-nav__link">
1764
1765
1766 <span class="md-ellipsis">
1767 BZIP2 Streams
1768
1769 </span>
1770
1771
1772 </a>
1773 </li>
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784 <li class="md-nav__item">
1785 <a href="ft2-debugging_apis.html" class="md-nav__link">
1786
1787
1788 <span class="md-ellipsis">
1789 External Debugging APIs
1790
1791 </span>
1792
1793
1794 </a>
1795 </li>
1796
1797
1798
1799
1800 </ul>
1801 </nav>
1802
1803 </li>
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817 <li class="md-nav__item md-nav__item--nested">
1818
1819
1820
1821 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
1822
1823
1824 <label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
1825
1826
1827 <span class="md-ellipsis">
1828 Error Codes
1829
1830 </span>
1831
1832
1833 <span class="md-nav__icon md-icon"></span>
1834 </label>
1835
1836 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
1837 <label class="md-nav__title" for="__nav_10">
1838 <span class="md-nav__icon md-icon"></span>
1839 Error Codes
1840 </label>
1841 <ul class="md-nav__list" data-md-scrollfix>
1842
1843
1844
1845
1846
1847
1848
1849 <li class="md-nav__item">
1850 <a href="ft2-error_enumerations.html" class="md-nav__link">
1851
1852
1853 <span class="md-ellipsis">
1854 Error Enumerations
1855
1856 </span>
1857
1858
1859 </a>
1860 </li>
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871 <li class="md-nav__item">
1872 <a href="ft2-error_code_values.html" class="md-nav__link">
1873
1874
1875 <span class="md-ellipsis">
1876 Error Code Values
1877
1878 </span>
1879
1880
1881 </a>
1882 </li>
1883
1884
1885
1886
1887 </ul>
1888 </nav>
1889
1890 </li>
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904 <li class="md-nav__item md-nav__item--nested">
1905
1906
1907
1908 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_11" >
1909
1910
1911 <label class="md-nav__link" for="__nav_11" id="__nav_11_label" tabindex="0">
1912
1913
1914 <span class="md-ellipsis">
1915 Miscellaneous
1916
1917 </span>
1918
1919
1920 <span class="md-nav__icon md-icon"></span>
1921 </label>
1922
1923 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_11_label" aria-expanded="false">
1924 <label class="md-nav__title" for="__nav_11">
1925 <span class="md-nav__icon md-icon"></span>
1926 Miscellaneous
1927 </label>
1928 <ul class="md-nav__list" data-md-scrollfix>
1929
1930
1931
1932
1933
1934
1935
1936 <li class="md-nav__item">
1937 <a href="ft2-gx_validation.html" class="md-nav__link">
1938
1939
1940 <span class="md-ellipsis">
1941 TrueTypeGX/AAT Validation
1942
1943 </span>
1944
1945
1946 </a>
1947 </li>
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958 <li class="md-nav__item">
1959 <a href="ft2-incremental.html" class="md-nav__link">
1960
1961
1962 <span class="md-ellipsis">
1963 Incremental Loading
1964
1965 </span>
1966
1967
1968 </a>
1969 </li>
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980 <li class="md-nav__item">
1981 <a href="ft2-truetype_engine.html" class="md-nav__link">
1982
1983
1984 <span class="md-ellipsis">
1985 The TrueType Engine
1986
1987 </span>
1988
1989
1990 </a>
1991 </li>
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002 <li class="md-nav__item">
2003 <a href="ft2-ot_validation.html" class="md-nav__link">
2004
2005
2006 <span class="md-ellipsis">
2007 OpenType Validation
2008
2009 </span>
2010
2011
2012 </a>
2013 </li>
2014
2015
2016
2017
2018 </ul>
2019 </nav>
2020
2021 </li>
2022
2023
2024
2025 </ul>
2026 </nav>
2027 </div>
2028 </div>
2029 </div>
2030
2031
2032
2033 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
2034 <div class="md-sidebar__scrollwrap">
2035 <div class="md-sidebar__inner">
2036
2037
2038 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
2039
2040
2041
2042
2043
2044
2045 <label class="md-nav__title" for="__toc">
2046 <span class="md-nav__icon md-icon"></span>
2047 Table of contents
2048 </label>
2049 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
2050
2051 <li class="md-nav__item">
2052 <a href="#synopsis" class="md-nav__link">
2053 <span class="md-ellipsis">
2054 Synopsis
2055 </span>
2056 </a>
2057
2058 </li>
2059
2060 <li class="md-nav__item">
2061 <a href="#ft_lcdfilter" class="md-nav__link">
2062 <span class="md-ellipsis">
2063 FT_LcdFilter
2064 </span>
2065 </a>
2066
2067 </li>
2068
2069 <li class="md-nav__item">
2070 <a href="#ft_library_setlcdfilter" class="md-nav__link">
2071 <span class="md-ellipsis">
2072 FT_Library_SetLcdFilter
2073 </span>
2074 </a>
2075
2076 </li>
2077
2078 <li class="md-nav__item">
2079 <a href="#ft_library_setlcdfilterweights" class="md-nav__link">
2080 <span class="md-ellipsis">
2081 FT_Library_SetLcdFilterWeights
2082 </span>
2083 </a>
2084
2085 </li>
2086
2087 <li class="md-nav__item">
2088 <a href="#ft_lcdfivetapfilter" class="md-nav__link">
2089 <span class="md-ellipsis">
2090 FT_LcdFiveTapFilter
2091 </span>
2092 </a>
2093
2094 </li>
2095
2096 <li class="md-nav__item">
2097 <a href="#ft_library_setlcdgeometry" class="md-nav__link">
2098 <span class="md-ellipsis">
2099 FT_Library_SetLcdGeometry
2100 </span>
2101 </a>
2102
2103 </li>
2104
2105 </ul>
2106
2107 </nav>
2108 </div>
2109 </div>
2110 </div>
2111
2112
2113
2114 <div class="md-content" data-md-component="content">
2115 <article class="md-content__inner md-typeset">
2116
2117
2118
2119
2120
2121 <p><a href="https://www.freetype.org">FreeType</a> &raquo; <a href="../">Docs</a> &raquo; <a href="index.html#controlling-freetype-modules">Controlling FreeType Modules</a> &raquo; Subpixel Rendering</p>
2122 <hr />
2123 <h1 id="subpixel-rendering">Subpixel Rendering<a class="headerlink" href="#subpixel-rendering" title="Permanent link">&para;</a></h1>
2124 <h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">&para;</a></h2>
2125 <p>FreeType provides two alternative subpixel rendering technologies. Should you define <code>FT_CONFIG_OPTION_SUBPIXEL_RENDERING</code> in your <code>ftoption.h</code> file, this enables ClearType-style rendering. Otherwise, Harmony LCD rendering is enabled. These technologies are controlled differently and API described below, although always available, performs its function when appropriate method is enabled and does nothing otherwise.</p>
2126 <p>ClearType-style LCD rendering exploits the color-striped structure of LCD pixels, increasing the available resolution in the direction of the stripe (usually horizontal RGB) by a factor of&nbsp;3. Using the subpixel coverages unfiltered can create severe color fringes especially when rendering thin features. Indeed, to produce black-on-white text, the nearby color subpixels must be dimmed evenly. Therefore, an equalizing 5-tap FIR filter should be applied to subpixel coverages regardless of pixel boundaries and should have these properties:</p>
2127 <ol>
2128 <li>
2129 <p>It should be symmetrical, like {&nbsp;a, b, c, b, a&nbsp;}, to avoid any shifts in appearance.</p>
2130 </li>
2131 <li>
2132 <p>It should be color-balanced, meaning a&nbsp;+ b&nbsp;=&nbsp;c, to reduce color fringes by distributing the computed coverage for one subpixel to all subpixels equally.</p>
2133 </li>
2134 <li>
2135 <p>It should be normalized, meaning 2a&nbsp;+ 2b&nbsp;+ c&nbsp;=&nbsp;1.0 to maintain overall brightness.</p>
2136 </li>
2137 </ol>
2138 <p>Boxy 3-tap filter {0, &#8531;, &#8531;, &#8531;, 0} is sharper but is less forgiving of non-ideal gamma curves of a screen (and viewing angles), beveled filters are fuzzier but more tolerant.</p>
2139 <p>Use the <code><a href="ft2-lcd_rendering.html#ft_library_setlcdfilter">FT_Library_SetLcdFilter</a></code> or <code><a href="ft2-lcd_rendering.html#ft_library_setlcdfilterweights">FT_Library_SetLcdFilterWeights</a></code> API to specify a low-pass filter, which is then applied to subpixel-rendered bitmaps generated through <code><a href="ft2-glyph_retrieval.html#ft_render_glyph">FT_Render_Glyph</a></code>.</p>
2140 <p>Harmony LCD rendering is suitable to panels with any regular subpixel structure, not just monitors with 3 color striped subpixels, as long as the color subpixels have fixed positions relative to the pixel center. In this case, each color channel can be rendered separately after shifting the outline opposite to the subpixel shift so that the coverage maps are aligned. This method is immune to color fringes because the shifts do not change integral coverage.</p>
2141 <p>The subpixel geometry must be specified by xy-coordinates for each subpixel. By convention they may come in the RGB order: {{-&#8531;, 0}, {0, 0}, {&#8531;, 0}} for standard RGB striped panel or {{-&#8537;, &frac14;}, {-&#8537;, -&frac14;}, {&#8531;, 0}} for a certain PenTile panel.</p>
2142 <p>Use the <code><a href="ft2-lcd_rendering.html#ft_library_setlcdgeometry">FT_Library_SetLcdGeometry</a></code> API to specify subpixel positions. If one follows the RGB order convention, the same order applies to the resulting <code><a href="ft2-basic_types.html#ft_pixel_mode">FT_PIXEL_MODE_LCD</a></code> and <code><a href="ft2-basic_types.html#ft_pixel_mode">FT_PIXEL_MODE_LCD_V</a></code> bitmaps. Note, however, that the coordinate frame for the latter must be rotated clockwise. Harmony with default LCD geometry is equivalent to ClearType with light filter.</p>
2143 <p>As a result of ClearType filtering or Harmony shifts, the resulting dimensions of LCD bitmaps can be slightly wider or taller than the dimensions the original outline with regard to the pixel grid. For example, for <code><a href="ft2-glyph_retrieval.html#ft_render_mode">FT_RENDER_MODE_LCD</a></code>, the filter adds 2&nbsp;subpixels to the left, and 2&nbsp;subpixels to the right. The bitmap offset values are adjusted accordingly, so clients shouldn't need to modify their layout and glyph positioning code when enabling the filter.</p>
2144 <p>The ClearType and Harmony rendering is applicable to glyph bitmaps rendered through <code><a href="ft2-glyph_retrieval.html#ft_render_glyph">FT_Render_Glyph</a></code>, <code><a href="ft2-glyph_retrieval.html#ft_load_glyph">FT_Load_Glyph</a></code>, <code><a href="ft2-character_mapping.html#ft_load_char">FT_Load_Char</a></code>, and <code><a href="ft2-glyph_management.html#ft_glyph_to_bitmap">FT_Glyph_To_Bitmap</a></code>, when <code><a href="ft2-glyph_retrieval.html#ft_render_mode">FT_RENDER_MODE_LCD</a></code> or <code><a href="ft2-glyph_retrieval.html#ft_render_mode">FT_RENDER_MODE_LCD_V</a></code> is specified. This API does not control <code><a href="ft2-outline_processing.html#ft_outline_render">FT_Outline_Render</a></code> and <code><a href="ft2-outline_processing.html#ft_outline_get_bitmap">FT_Outline_Get_Bitmap</a></code>.</p>
2145 <p>The described algorithms can completely remove color artefacts when combined with gamma-corrected alpha blending in linear space. Each of the 3&nbsp;alpha values (subpixels) must by independently used to blend one color channel. That is, red alpha blends the red channel of the text color with the red channel of the background pixel.</p>
2146 <h2 id="ft_lcdfilter">FT_LcdFilter<a class="headerlink" href="#ft_lcdfilter" title="Permanent link">&para;</a></h2>
2147 <p>Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h).</p>
2148 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">enum</span> FT_LcdFilter_
2149 {
2150 <a href="ft2-lcd_rendering.html#ft_lcd_filter_none">FT_LCD_FILTER_NONE</a> = 0,
2151 <a href="ft2-lcd_rendering.html#ft_lcd_filter_default">FT_LCD_FILTER_DEFAULT</a> = 1,
2152 <a href="ft2-lcd_rendering.html#ft_lcd_filter_light">FT_LCD_FILTER_LIGHT</a> = 2,
2153 <a href="ft2-lcd_rendering.html#ft_lcd_filter_legacy1">FT_LCD_FILTER_LEGACY1</a> = 3,
2154 <a href="ft2-lcd_rendering.html#ft_lcd_filter_legacy">FT_LCD_FILTER_LEGACY</a> = 16,
2155
2156 FT_LCD_FILTER_MAX /* do not remove */
2157
2158 } <b>FT_LcdFilter</b>;
2159 </code></pre></div>
2160
2161 <p>A list of values to identify various types of LCD filters.</p>
2162 <h4>values</h4>
2163 <table class="fields">
2164 <tr><td class="val" id="ft_lcd_filter_none">FT_LCD_FILTER_NONE</td><td class="desc">
2165 <p>Do not perform filtering. When used with subpixel rendering, this results in sometimes severe color fringes.</p>
2166 </td></tr>
2167 <tr><td class="val" id="ft_lcd_filter_default">FT_LCD_FILTER_DEFAULT</td><td class="desc">
2168 <p>This is a beveled, normalized, and color-balanced five-tap filter with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256 units.</p>
2169 </td></tr>
2170 <tr><td class="val" id="ft_lcd_filter_light">FT_LCD_FILTER_LIGHT</td><td class="desc">
2171 <p>this is a boxy, normalized, and color-balanced three-tap filter with weights of [0x00 0x55 0x56 0x55 0x00] in 1/256 units.</p>
2172 </td></tr>
2173 <tr><td class="val" id="ft_lcd_filter_legacy">FT_LCD_FILTER_LEGACY</td><td class="desc">
2174
2175 </td></tr>
2176 <tr><td class="val" id="ft_lcd_filter_legacy1">FT_LCD_FILTER_LEGACY1</td><td class="desc">
2177 <p>The legacy libXft color filter is no longer supported and ignored.</p>
2178 </td></tr>
2179 </table>
2180
2181 <h4>since</h4>
2182
2183 <p>2.3.0</p>
2184 <hr>
2185
2186 <h2 id="ft_library_setlcdfilter">FT_Library_SetLcdFilter<a class="headerlink" href="#ft_library_setlcdfilter" title="Permanent link">&para;</a></h2>
2187 <p>Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h).</p>
2188 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
2189 <b>FT_Library_SetLcdFilter</b>( <a href="ft2-library_setup.html#ft_library">FT_Library</a> library,
2190 <a href="ft2-lcd_rendering.html#ft_lcdfilter">FT_LcdFilter</a> filter );
2191 </code></pre></div>
2192
2193 <p>This function is used to change filter applied to LCD decimated bitmaps, like the ones used when calling <code><a href="ft2-glyph_retrieval.html#ft_render_glyph">FT_Render_Glyph</a></code> with <code><a href="ft2-glyph_retrieval.html#ft_render_mode">FT_RENDER_MODE_LCD</a></code> or <code><a href="ft2-glyph_retrieval.html#ft_render_mode">FT_RENDER_MODE_LCD_V</a></code>.</p>
2194 <h4>input</h4>
2195 <table class="fields">
2196 <tr><td class="val" id="library">library</td><td class="desc">
2197 <p>A handle to the target library instance.</p>
2198 </td></tr>
2199 <tr><td class="val" id="filter">filter</td><td class="desc">
2200 <p>The filter type.</p>
2201 <p>You can use <code><a href="ft2-lcd_rendering.html#ft_lcdfilter">FT_LCD_FILTER_NONE</a></code> here to disable this feature, or <code><a href="ft2-lcd_rendering.html#ft_lcdfilter">FT_LCD_FILTER_DEFAULT</a></code> to use a default filter that should work well on most LCD screens.</p>
2202 </td></tr>
2203 </table>
2204
2205 <h4>return</h4>
2206
2207 <p>FreeType error code. 0&nbsp;means success.</p>
2208 <h4>note</h4>
2209
2210 <p>Since 2.10.3 the LCD filtering is enabled with <code><a href="ft2-lcd_rendering.html#ft_lcdfilter">FT_LCD_FILTER_DEFAULT</a></code>. It is no longer necessary to call this function explicitly except to choose a different filter or disable filtering altogether with <code><a href="ft2-lcd_rendering.html#ft_lcdfilter">FT_LCD_FILTER_NONE</a></code>.</p>
2211 <p>This function does nothing but returns <code>FT_Err_Unimplemented_Feature</code> if the configuration macro <code>FT_CONFIG_OPTION_SUBPIXEL_RENDERING</code> is not defined in your build of the library.</p>
2212 <h4>since</h4>
2213
2214 <p>2.3.0</p>
2215 <hr>
2216
2217 <h2 id="ft_library_setlcdfilterweights">FT_Library_SetLcdFilterWeights<a class="headerlink" href="#ft_library_setlcdfilterweights" title="Permanent link">&para;</a></h2>
2218 <p>Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h).</p>
2219 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
2220 <b>FT_Library_SetLcdFilterWeights</b>( <a href="ft2-library_setup.html#ft_library">FT_Library</a> library,
2221 <span class="keyword">unsigned</span> <span class="keyword">char</span> *weights );
2222 </code></pre></div>
2223
2224 <p>This function can be used to enable LCD filter with custom weights, instead of using presets in <code><a href="ft2-lcd_rendering.html#ft_library_setlcdfilter">FT_Library_SetLcdFilter</a></code>.</p>
2225 <h4>input</h4>
2226 <table class="fields">
2227 <tr><td class="val" id="library">library</td><td class="desc">
2228 <p>A handle to the target library instance.</p>
2229 </td></tr>
2230 <tr><td class="val" id="weights">weights</td><td class="desc">
2231 <p>A pointer to an array; the function copies the first five bytes and uses them to specify the filter weights in 1/256 units.</p>
2232 </td></tr>
2233 </table>
2234
2235 <h4>return</h4>
2236
2237 <p>FreeType error code. 0&nbsp;means success.</p>
2238 <h4>note</h4>
2239
2240 <p>This function does nothing but returns <code>FT_Err_Unimplemented_Feature</code> if the configuration macro <code>FT_CONFIG_OPTION_SUBPIXEL_RENDERING</code> is not defined in your build of the library.</p>
2241 <p>LCD filter weights can also be set per face using <code><a href="ft2-face_creation.html#ft_face_properties">FT_Face_Properties</a></code> with <code><a href="ft2-parameter_tags.html#ft_param_tag_lcd_filter_weights">FT_PARAM_TAG_LCD_FILTER_WEIGHTS</a></code>.</p>
2242 <h4>since</h4>
2243
2244 <p>2.4.0</p>
2245 <hr>
2246
2247 <h2 id="ft_lcdfivetapfilter">FT_LcdFiveTapFilter<a class="headerlink" href="#ft_lcdfivetapfilter" title="Permanent link">&para;</a></h2>
2248 <p>Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h).</p>
2249 <div class = "codehilite"><pre><code>#<span class="keyword">define</span> FT_LCD_FILTER_FIVE_TAPS 5
2250
2251 <span class="keyword">typedef</span> <a href="ft2-basic_types.html#ft_byte">FT_Byte</a> <b>FT_LcdFiveTapFilter</b>[FT_LCD_FILTER_FIVE_TAPS];
2252 </code></pre></div>
2253
2254 <p>A typedef for passing the five LCD filter weights to <code><a href="ft2-face_creation.html#ft_face_properties">FT_Face_Properties</a></code> within an <code><a href="ft2-face_creation.html#ft_parameter">FT_Parameter</a></code> structure.</p>
2255 <h4>since</h4>
2256
2257 <p>2.8</p>
2258 <hr>
2259
2260 <h2 id="ft_library_setlcdgeometry">FT_Library_SetLcdGeometry<a class="headerlink" href="#ft_library_setlcdgeometry" title="Permanent link">&para;</a></h2>
2261 <p>Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h).</p>
2262 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
2263 <b>FT_Library_SetLcdGeometry</b>( <a href="ft2-library_setup.html#ft_library">FT_Library</a> library,
2264 <a href="ft2-basic_types.html#ft_vector">FT_Vector</a> sub[3] );
2265 </code></pre></div>
2266
2267 <p>This function can be used to modify default positions of color subpixels, which controls Harmony LCD rendering.</p>
2268 <h4>input</h4>
2269 <table class="fields">
2270 <tr><td class="val" id="library">library</td><td class="desc">
2271 <p>A handle to the target library instance.</p>
2272 </td></tr>
2273 <tr><td class="val" id="sub">sub</td><td class="desc">
2274 <p>A pointer to an array of 3 vectors in 26.6 fractional pixel format; the function modifies the default values, see the note below.</p>
2275 </td></tr>
2276 </table>
2277
2278 <h4>return</h4>
2279
2280 <p>FreeType error code. 0&nbsp;means success.</p>
2281 <h4>note</h4>
2282
2283 <p>Subpixel geometry examples:</p>
2284 <ul>
2285 <li>
2286 <p>{{-21, 0}, {0, 0}, {21, 0}} is the default, corresponding to 3 color stripes shifted by a third of a pixel. This could be an RGB panel.</p>
2287 </li>
2288 <li>
2289 <p>{{21, 0}, {0, 0}, {-21, 0}} looks the same as the default but can specify a BGR panel instead, while keeping the bitmap in the same RGB888 format.</p>
2290 </li>
2291 <li>
2292 <p>{{0, 21}, {0, 0}, {0, -21}} is the vertical RGB, but the bitmap stays RGB888 as a result.</p>
2293 </li>
2294 <li>
2295 <p>{{-11, 16}, {-11, -16}, {22, 0}} is a certain PenTile arrangement.</p>
2296 </li>
2297 </ul>
2298 <p>This function does nothing and returns <code>FT_Err_Unimplemented_Feature</code> in the context of ClearType-style subpixel rendering when <code>FT_CONFIG_OPTION_SUBPIXEL_RENDERING</code> is defined in your build of the library.</p>
2299 <h4>since</h4>
2300
2301 <p>2.10.0</p>
2302 <hr>
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316 </article>
2317 </div>
2318
2319
2320 <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
2321 </div>
2322
2323 </main>
2324
2325 <footer class="md-footer">
2326
2327 <div class="md-footer-meta md-typeset">
2328 <div class="md-footer-meta__inner md-grid">
2329 <div class="md-copyright">
2330
2331 <div class="md-copyright__highlight">
2332 Copyright 2026 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
2333 </div>
2334
2335
2336 Made with
2337 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
2338 Material for MkDocs
2339 </a>
2340
2341 </div>
2342
2343 </div>
2344 </div>
2345 </footer>
2346
2347 </div>
2348 <div class="md-dialog" data-md-component="dialog">
2349 <div class="md-dialog__inner md-typeset"></div>
2350 </div>
2351
2352
2353 <script id="__config" type="application/json">{"base": ".", "features": [], "search": "assets/javascripts/workers/search.f8cc74c7.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
2354
2355
2356 <script src="assets/javascripts/bundle.c8b220af.min.js"></script>
2357
2358 <script src="javascripts/extra.js"></script>
2359
2360
2361 </body>
2362 </html>