ReactOS 0.4.16-dev-983-g23ad936
font.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS win32 kernel mode subsystem
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: win32ss/gdi/ntgdi/font.c
5 * PURPOSE: Font
6 * PROGRAMMERS: James Tabor <james.tabor@reactos.org>
7 * Timo Kreuzer <timo.kreuzer@reactos.org>
8 * Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
9 */
10
13#include <win32k.h>
14
15#define NDEBUG
16#include <debug.h>
17
19
24{
25 if (lplf)
26 {
27 ENUMLOGFONTEXDVW Logfont;
28
29 RtlCopyMemory( &Logfont.elfEnumLogfontEx.elfLogFont, lplf, sizeof(LOGFONTW));
31 sizeof(Logfont.elfEnumLogfontEx.elfFullName));
33 sizeof(Logfont.elfEnumLogfontEx.elfStyle));
35 sizeof(Logfont.elfEnumLogfontEx.elfScript));
36
37 Logfont.elfDesignVector.dvNumAxes = 0;
38
39 RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR));
40
41 return HfontCreate((PENUMLOGFONTEXDVW)&Logfont, 0, 0, 0, NULL );
42 }
43 else return NULL;
44}
45
49 HDC hDC,
50 ULONG NumPairs,
51 LPKERNINGPAIR krnpair)
52{
53 PDC dc;
54 PDC_ATTR pdcattr;
55 PTEXTOBJ TextObj;
56 PFONTGDI FontGDI;
58 KERNINGPAIR *pKP;
59
60 dc = DC_LockDc(hDC);
61 if (!dc)
62 {
64 return 0;
65 }
66
67 pdcattr = dc->pdcattr;
68 TextObj = RealizeFontInit(pdcattr->hlfntNew);
70
71 if (!TextObj)
72 {
74 return 0;
75 }
76
77 FontGDI = ObjToGDI(TextObj->Font, FONT);
78 TEXTOBJ_UnlockText(TextObj);
79
80 Count = ftGdiGetKerningPairs(FontGDI,0,NULL);
81
82 if ( Count && krnpair )
83 {
84 if (Count > NumPairs)
85 {
87 return 0;
88 }
90 if (!pKP)
91 {
93 return 0;
94 }
95 ftGdiGetKerningPairs(FontGDI,Count,pKP);
96
97 RtlCopyMemory(krnpair, pKP, Count * sizeof(KERNINGPAIR));
98
100 }
101 return Count;
102}
103
104/*
105
106 It is recommended that an application use the GetFontLanguageInfo function
107 to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE,
108 GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the
109 currently selected font. If not valid, GetCharacterPlacement ignores the
110 value.
111
112 MS must use a preset "compiled in" support for each language based releases.
113 ReactOS uses FreeType, this will need to be supported. ATM this is hard coded
114 for GCPCLASS_LATIN!
115
116 */
117#if 0
118DWORD
120GreGetCharacterPlacementW(
121 HDC hdc,
122 LPCWSTR pwsz,
123 INT nCount,
124 INT nMaxExtent,
125 LPGCP_RESULTSW pgcpw,
127{
128 GCP_RESULTSW gcpwSave;
129 UINT i, nSet, cSet;
130 INT *tmpDxCaretPos;
131 LONG Cx;
132 SIZE Size = {0,0};
133
134 DPRINT1("GreGCPW Start\n");
135
136 if (!pgcpw)
137 {
138 if (GreGetTextExtentW( hdc, pwsz, nCount, &Size, 1))
139 return MAKELONG(Size.cx, Size.cy);
140 return 0;
141 }
142
143 DPRINT1("GreGCPW 1\n");
144
145 RtlCopyMemory(&gcpwSave, pgcpw, sizeof(GCP_RESULTSW));
146
147 cSet = nSet = nCount;
148
149 if ( nCount > gcpwSave.nGlyphs ) cSet = gcpwSave.nGlyphs;
150
151 /* GCP_JUSTIFY may only be used in conjunction with GCP_MAXEXTENT. */
153
154 if ( !gcpwSave.lpDx && gcpwSave.lpCaretPos )
155 tmpDxCaretPos = gcpwSave.lpCaretPos;
156 else
157 tmpDxCaretPos = gcpwSave.lpDx;
158
160 pwsz,
161 cSet,
162 nMaxExtent,
163 ((dwFlags & GCP_MAXEXTENT) ? (PULONG) &cSet : NULL),
164 (PULONG) tmpDxCaretPos,
165 &Size,
166 0) )
167 {
168 return 0;
169 }
170
171 DPRINT1("GreGCPW 2\n");
172
173 nSet = cSet;
174
175 if ( tmpDxCaretPos && nSet > 0)
176 {
177 for (i = (nSet - 1); i > 0; i--)
178 {
179 tmpDxCaretPos[i] -= tmpDxCaretPos[i - 1];
180 }
181 }
182
183 if ( !(dwFlags & GCP_MAXEXTENT) || nSet )
184 {
185 if ( (dwFlags & GCP_USEKERNING) &&
186 ( gcpwSave.lpDx ||
187 gcpwSave.lpCaretPos ) &&
188 nSet >= 2 )
189 {
190 DWORD Count;
191 LPKERNINGPAIR pKP;
192
194 if (Count)
195 {
197 if (pKP)
198 {
199 if ( GreGetKerningPairs( hdc, Count, pKP) != Count)
200 {
202 return 0;
203 }
204
205 if ( (ULONG_PTR)(pKP) < ((ULONG_PTR)(pKP) + (ULONG_PTR)(Count * sizeof(KERNINGPAIR))) )
206 {
207 DPRINT1("We Need to Do Something HERE!\n");
208 }
209
211
212 if ( dwFlags & GCP_MAXEXTENT )
213 {
214 if ( Size.cx > nMaxExtent )
215 {
216 for (Cx = Size.cx; nSet > 0; nSet--)
217 {
218 Cx -= tmpDxCaretPos[nSet - 1];
219 Size.cx = Cx;
220 if ( Cx <= nMaxExtent ) break;
221 }
222 }
223 if ( !nSet )
224 {
225 pgcpw->nGlyphs = 0;
226 pgcpw->nMaxFit = 0;
227 return 0;
228 }
229 }
230 }
231 }
232 }
233
234 if ( (dwFlags & GCP_JUSTIFY) &&
235 ( gcpwSave.lpDx ||
236 gcpwSave.lpCaretPos ) &&
237 nSet )
238 {
239 DPRINT1("We Need to Do Something HERE 2!\n");
240 }
241
242 if ( gcpwSave.lpDx && gcpwSave.lpCaretPos )
243 RtlCopyMemory( gcpwSave.lpCaretPos, gcpwSave.lpDx, nSet * sizeof(LONG));
244
245 if ( gcpwSave.lpCaretPos )
246 {
247 int pos = 0;
248 i = 0;
249 if ( nSet > 0 )
250 {
251 do
252 {
253 Cx = gcpwSave.lpCaretPos[i];
254 gcpwSave.lpCaretPos[i] = pos;
255 pos += Cx;
256 ++i;
257 }
258 while ( i < nSet );
259 }
260 }
261
262 if ( gcpwSave.lpOutString )
263 RtlCopyMemory(gcpwSave.lpOutString, pwsz, nSet * sizeof(WCHAR));
264
265 if ( gcpwSave.lpClass )
266 RtlFillMemory(gcpwSave.lpClass, nSet, GCPCLASS_LATIN);
267
268 if ( gcpwSave.lpOrder )
269 {
270 for (i = 0; i < nSet; i++)
271 gcpwSave.lpOrder[i] = i;
272 }
273
274 if ( gcpwSave.lpGlyphs )
275 {
276 if ( GreGetGlyphIndicesW( hdc, pwsz, nSet, gcpwSave.lpGlyphs, 0, 0) == GDI_ERROR )
277 {
278 nSet = 0;
279 Size.cx = 0;
280 Size.cy = 0;
281 }
282 }
283 pgcpw->nGlyphs = nSet;
284 pgcpw->nMaxFit = nSet;
285 }
286 DPRINT1("GreGCPW Exit\n");
287 return MAKELONG(Size.cx, Size.cy);
288}
289#endif
290
291ULONG
294{
295 ULONG cjMaxSize;
296 ENUMLOGFONTEXDVW *plf;
297
298 ASSERT(plfont);
299 plf = &plfont->logfont;
300
301 if (!(plfont->fl & TEXTOBJECT_INIT))
302 {
304 DPRINT("FontGetObject font not initialized!\n");
305
306 Status = TextIntRealizeFont(plfont->BaseObject.hHmgr, plfont);
307 if (!NT_SUCCESS(Status))
308 {
309 DPRINT1("FontGetObject(TextIntRealizeFont) Status = 0x%lx\n", Status);
310 }
311 }
312
313 /* If buffer is NULL, only the size is requested */
314 if (pvBuffer == NULL) return sizeof(LOGFONTW);
315
316 /* Calculate the maximum size according to number of axes */
317 cjMaxSize = FIELD_OFFSET(ENUMLOGFONTEXDVW,
318 elfDesignVector.dvValues[plf->elfDesignVector.dvNumAxes]);
319
320 if (cjBuffer > cjMaxSize) cjBuffer = cjMaxSize;
321
322 RtlCopyMemory(pvBuffer, plf, cjBuffer);
323
324 return cjBuffer;
325}
326
327DWORD
330{
331 PDC pdc;
332 PDC_ATTR pdcattr;
333 PTEXTOBJ TextObj;
334 SIZE sz;
335 TMW_INTERNAL tmwi;
336 BOOL Good;
337
338 static const WCHAR alphabet[] = {
339 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
340 'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
341 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
342
343 if(!ftGdiGetTextMetricsW(hdc, &tmwi)) return 0;
344
345 pdc = DC_LockDc(hdc);
346
347 if (!pdc) return 0;
348
349 pdcattr = pdc->pdcattr;
350
351 TextObj = RealizeFontInit(pdcattr->hlfntNew);
352 if ( !TextObj )
353 {
354 DC_UnlockDc(pdc);
355 return 0;
356 }
357 Good = TextIntGetTextExtentPoint(pdc, TextObj, alphabet, 52, 0, NULL, 0, &sz, 0);
358 TEXTOBJ_UnlockText(TextObj);
359 DC_UnlockDc(pdc);
360
361 if (!Good) return 0;
362 if (ptm) *ptm = tmwi.TextMetric;
363 if (height) *height = tmwi.TextMetric.tmHeight;
364
365 return (sz.cx / 26 + 1) / 2;
366}
367
368
369DWORD
372{
373 PDC_ATTR pdcattr;
374 FONTSIGNATURE fontsig;
375 static const DWORD GCP_DBCS_MASK=0x003F0000,
376 GCP_DIACRITIC_MASK=0x00000000,
377 FLI_GLYPHS_MASK=0x00000000,
378 GCP_GLYPHSHAPE_MASK=0x00000040,
379 GCP_KASHIDA_MASK=0x00000000,
380 GCP_LIGATE_MASK=0x00000000,
381 GCP_USEKERNING_MASK=0x00000000,
382 GCP_REORDER_MASK=0x00000060;
383
384 DWORD result=0;
385
386 ftGdiGetTextCharsetInfo( Dc, &fontsig, 0 );
387
388 /* We detect each flag we return using a bitmask on the Codepage Bitfields */
389 if( (fontsig.fsCsb[0]&GCP_DBCS_MASK)!=0 )
391
392 if( (fontsig.fsCsb[0]&GCP_DIACRITIC_MASK)!=0 )
394
395 if( (fontsig.fsCsb[0]&FLI_GLYPHS_MASK)!=0 )
397
398 if( (fontsig.fsCsb[0]&GCP_GLYPHSHAPE_MASK)!=0 )
400
401 if( (fontsig.fsCsb[0]&GCP_KASHIDA_MASK)!=0 )
403
404 if( (fontsig.fsCsb[0]&GCP_LIGATE_MASK)!=0 )
406
407 if( (fontsig.fsCsb[0]&GCP_USEKERNING_MASK)!=0 )
409
410 pdcattr = Dc->pdcattr;
411
412 /* This might need a test for a HEBREW- or ARABIC_CHARSET as well */
413 if ( pdcattr->flTextAlign & TA_RTLREADING )
414 if( (fontsig.fsCsb[0]&GCP_REORDER_MASK)!=0 )
416
417 return result;
418}
419
423{
425 PTEXTOBJ pTextObj;
426
427 pTextObj = TEXTOBJ_LockText(hFont);
428
429 if ( pTextObj && !(pTextObj->fl & TEXTOBJECT_INIT))
430 {
431 Status = TextIntRealizeFont(hFont, pTextObj);
432 if (!NT_SUCCESS(Status))
433 {
434 TEXTOBJ_UnlockText(pTextObj);
435 return NULL;
436 }
437 }
438 return pTextObj;
439}
440
441static BOOL
443 _In_reads_(cwc) WCHAR *pwcFiles,
444 _In_ ULONG cFiles,
445 _In_ ULONG cwc)
446{
447 ULONG ich, cRealFiles;
448
449 if (pwcFiles[cwc - 1] != UNICODE_NULL)
450 return FALSE;
451
452 for (ich = cRealFiles = 0; ich < cwc; ++ich)
453 {
454 if (!pwcFiles[ich])
455 ++cRealFiles;
456 }
457
458 return cRealFiles >= cFiles;
459}
460
463INT
466 _In_reads_(cwc) WCHAR *pwcFiles,
467 _In_ ULONG cwc,
468 _In_ ULONG cFiles,
469 _In_ FLONG fl,
470 _In_ DWORD dwPidTid,
472{
473 UNICODE_STRING SafeFileName;
474 INT Ret;
475
478
479 DPRINT("NtGdiAddFontResourceW\n");
480
481 /* cwc = Length + trailing zero. */
482 if ((cwc <= 1) || (cwc > UNICODE_STRING_MAX_CHARS))
483 return 0;
484
485 SafeFileName.Length = (USHORT)((cwc - 1) * sizeof(WCHAR));
486 SafeFileName.MaximumLength = SafeFileName.Length + sizeof(UNICODE_NULL);
488 SafeFileName.MaximumLength,
489 TAG_STRING);
490 if (!SafeFileName.Buffer)
491 return 0;
492
494 {
495 ProbeForRead(pwcFiles, cwc * sizeof(WCHAR), sizeof(WCHAR));
496
497 if (!IntCheckFontPathNames(pwcFiles, cFiles, cwc))
498 return 0;
499
500 RtlCopyMemory(SafeFileName.Buffer, pwcFiles, SafeFileName.Length);
501 }
503 {
504 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
505 _SEH2_YIELD(return 0);
506 }
507 _SEH2_END;
508
509 SafeFileName.Buffer[SafeFileName.Length / sizeof(WCHAR)] = UNICODE_NULL;
510
511 Ret = IntGdiAddFontResourceEx(&SafeFileName, cFiles, fl, 0);
512
513 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
514 return Ret;
515}
516
517BOOL
520 _In_reads_(cwc) WCHAR *pwszFiles,
521 _In_ ULONG cwc,
522 _In_ ULONG cFiles,
523 _In_ ULONG fl,
524 _In_ DWORD dwPidTid,
526{
527 UNICODE_STRING SafeFileName;
528 BOOL Ret;
529
532
533 DPRINT("NtGdiRemoveFontResourceW\n");
534
535 /* cwc = Length + trailing zero. */
536 if ((cwc <= 1) || (cwc > UNICODE_STRING_MAX_CHARS))
537 return FALSE;
538
539 SafeFileName.Length = (USHORT)((cwc - 1) * sizeof(WCHAR));
540 SafeFileName.MaximumLength = SafeFileName.Length + sizeof(UNICODE_NULL);
542 SafeFileName.MaximumLength,
543 TAG_STRING);
544 if (!SafeFileName.Buffer)
545 return FALSE;
546
548 {
549 ProbeForRead(pwszFiles, cwc * sizeof(WCHAR), sizeof(WCHAR));
550
551 if (!IntCheckFontPathNames(pwszFiles, cFiles, cwc))
552 return FALSE;
553
554 RtlCopyMemory(SafeFileName.Buffer, pwszFiles, SafeFileName.Length);
555 }
557 {
558 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
559 _SEH2_YIELD(return FALSE);
560 }
561 _SEH2_END;
562
563 SafeFileName.Buffer[SafeFileName.Length / sizeof(WCHAR)] = UNICODE_NULL;
564
565 Ret = IntGdiRemoveFontResource(&SafeFileName, cFiles, fl);
566
567 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
568 return Ret;
569}
570
571HANDLE
574 IN PVOID pvBuffer,
577 IN ULONG cjDV,
578 OUT DWORD *pNumFonts)
579{
581 HANDLE Ret;
582 DWORD NumFonts = 0;
583
584 DPRINT("NtGdiAddFontMemResourceEx\n");
587
588 if (!pvBuffer || !cjBuffer)
589 return NULL;
590
592 {
593 ProbeForRead(pvBuffer, cjBuffer, sizeof(BYTE));
595 RtlCopyMemory(Buffer, pvBuffer, cjBuffer);
596 }
598 {
599 if (Buffer != NULL)
600 {
602 }
603 _SEH2_YIELD(return NULL);
604 }
605 _SEH2_END;
606
607 Ret = IntGdiAddFontMemResource(Buffer, cjBuffer, &NumFonts);
609
611 {
612 ProbeForWrite(pNumFonts, sizeof(NumFonts), 1);
613 *pNumFonts = NumFonts;
614 }
616 {
617 /* Leak it? */
618 _SEH2_YIELD(return NULL);
619 }
620 _SEH2_END;
621
622
623 return Ret;
624}
625
626
627BOOL
630 IN HANDLE hMMFont)
631{
632 return IntGdiRemoveFontMemResource(hMMFont);
633}
634
635
636 /*
637 * @unimplemented
638 */
639DWORD
642 IN HDC hdc,
643 IN LPWSTR pwsz,
644 IN INT nCount,
645 IN INT nMaxExtent,
646 IN OUT LPGCP_RESULTSW pgcpw,
648{
650 return 0;
651#if 0
652 return GreGetCharacterPlacementW( hdc,
653 pwsz,
654 nCount,
655 nMaxExtent,
656 pgcpw,
657 dwFlags);
658#endif
659}
660
661DWORD
664 HDC hDC,
665 DWORD Table,
668 DWORD Size)
669{
670 PDC Dc;
671 PDC_ATTR pdcattr;
672 HFONT hFont;
673 PTEXTOBJ TextObj;
674 PFONTGDI FontGdi;
677
678 if (Buffer && Size)
679 {
681 {
683 }
685 {
687 }
689 }
690
691 if (!NT_SUCCESS(Status)) return Result;
692
693 Dc = DC_LockDc(hDC);
694 if (Dc == NULL)
695 {
697 return GDI_ERROR;
698 }
699 pdcattr = Dc->pdcattr;
700
701 hFont = pdcattr->hlfntNew;
702 TextObj = RealizeFontInit(hFont);
703 DC_UnlockDc(Dc);
704
705 if (TextObj == NULL)
706 {
708 return GDI_ERROR;
709 }
710
711 FontGdi = ObjToGDI(TextObj->Font, FONT);
712
714
715 TEXTOBJ_UnlockText(TextObj);
716
717 return Result;
718}
719
720 /*
721 * @implemented
722 */
723DWORD
726 IN HDC hdc,
727 OUT OPTIONAL LPGLYPHSET pgs)
728{
729 PDC pDc;
730 PDC_ATTR pdcattr;
731 HFONT hFont;
732 PTEXTOBJ TextObj;
733 PFONTGDI FontGdi;
734 DWORD Size = 0;
735 PGLYPHSET pgsSafe;
737
738 pDc = DC_LockDc(hdc);
739 if (!pDc)
740 {
742 return 0;
743 }
744
745 pdcattr = pDc->pdcattr;
746
747 hFont = pdcattr->hlfntNew;
748 TextObj = RealizeFontInit(hFont);
749
750 if ( TextObj == NULL)
751 {
753 goto Exit;
754 }
755 FontGdi = ObjToGDI(TextObj->Font, FONT);
756
757 Size = ftGetFontUnicodeRanges( FontGdi, NULL);
758
759 if (Size && pgs)
760 {
762 if (!pgsSafe)
763 {
765 Size = 0;
766 goto Exit;
767 }
768
769 Size = ftGetFontUnicodeRanges( FontGdi, pgsSafe);
770
771 if (Size)
772 {
774 {
775 ProbeForWrite(pgs, Size, 1);
776 RtlCopyMemory(pgs, pgsSafe, Size);
777 }
779 {
781 }
783
784 if (!NT_SUCCESS(Status)) Size = 0;
785 }
787 }
788Exit:
789 TEXTOBJ_UnlockText(TextObj);
790 DC_UnlockDc(pDc);
791 return Size;
792}
793
794ULONG
797 IN HDC hdc,
798 IN WCHAR wch,
801 IN ULONG cjBuf,
802 OUT OPTIONAL PVOID UnsafeBuf,
803 IN LPMAT2 pmat2,
804 IN BOOL bIgnoreRotation)
805{
806 ULONG Ret = GDI_ERROR;
807 PDC dc;
808 PVOID pvBuf = NULL;
809 GLYPHMETRICS gm;
811
812 dc = DC_LockDc(hdc);
813 if (!dc)
814 {
816 return GDI_ERROR;
817 }
818
819 if (UnsafeBuf && cjBuf)
820 {
822 if (!pvBuf)
823 {
825 goto Exit;
826 }
827 }
828
830 wch,
831 iFormat,
832 pgm ? &gm : NULL,
833 cjBuf,
834 pvBuf,
835 pmat2,
836 bIgnoreRotation);
837
838 if (pvBuf)
839 {
841 {
842 ProbeForWrite(UnsafeBuf, cjBuf, 1);
843 RtlCopyMemory(UnsafeBuf, pvBuf, cjBuf);
844 }
846 {
848 }
850
852 }
853
854 if (pgm)
855 {
857 {
858 ProbeForWrite(pgm, sizeof(GLYPHMETRICS), 1);
859 RtlCopyMemory(pgm, &gm, sizeof(GLYPHMETRICS));
860 }
862 {
864 }
866 }
867
868 if (! NT_SUCCESS(Status))
869 {
871 Ret = GDI_ERROR;
872 }
873
874Exit:
876 return Ret;
877}
878
879DWORD
882 ULONG NumPairs,
883 LPKERNINGPAIR krnpair)
884{
885 PDC dc;
886 PDC_ATTR pdcattr;
887 PTEXTOBJ TextObj;
888 PFONTGDI FontGDI;
889 DWORD Count;
890 KERNINGPAIR *pKP;
892
893 dc = DC_LockDc(hDC);
894 if (!dc)
895 {
897 return 0;
898 }
899
900 pdcattr = dc->pdcattr;
901 TextObj = RealizeFontInit(pdcattr->hlfntNew);
903
904 if (!TextObj)
905 {
907 return 0;
908 }
909
910 FontGDI = ObjToGDI(TextObj->Font, FONT);
911 TEXTOBJ_UnlockText(TextObj);
912
913 Count = ftGdiGetKerningPairs(FontGDI,0,NULL);
914
915 if ( Count && krnpair )
916 {
917 if (Count > NumPairs)
918 {
920 return 0;
921 }
923 if (!pKP)
924 {
926 return 0;
927 }
928 ftGdiGetKerningPairs(FontGDI,Count,pKP);
930 {
931 ProbeForWrite(krnpair, Count * sizeof(KERNINGPAIR), 1);
932 RtlCopyMemory(krnpair, pKP, Count * sizeof(KERNINGPAIR));
933 }
935 {
937 }
939 if (!NT_SUCCESS(Status))
940 {
942 Count = 0;
943 }
945 }
946 return Count;
947}
948
949/*
950 From "Undocumented Windows 2000 Secrets" Appendix B, Table B-2, page
951 472, this is NtGdiGetOutlineTextMetricsInternalW.
952 */
953ULONG
956 ULONG Data,
958 TMDIFF *Tmd)
959{
960 PDC dc;
961 PDC_ATTR pdcattr;
962 PTEXTOBJ TextObj;
963 PFONTGDI FontGDI;
964 HFONT hFont = 0;
965 ULONG Size;
966 OUTLINETEXTMETRICW *potm;
968
969 dc = DC_LockDc(hDC);
970 if (!dc)
971 {
973 return 0;
974 }
975 pdcattr = dc->pdcattr;
976 hFont = pdcattr->hlfntNew;
977 TextObj = RealizeFontInit(hFont);
979 if (!TextObj)
980 {
982 return 0;
983 }
984 FontGDI = ObjToGDI(TextObj->Font, FONT);
985 if (!(FontGDI->flType & FO_TYPE_TRUETYPE))
986 {
987 TEXTOBJ_UnlockText(TextObj);
988 return 0;
989 }
990 TextIntUpdateSize(dc, TextObj, FontGDI, TRUE);
991 TEXTOBJ_UnlockText(TextObj);
992 Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL, FALSE);
993 if (!otm) return Size;
994 if (Size > Data)
995 {
997 return 0;
998 }
1000 if (!potm)
1001 {
1003 return 0;
1004 }
1005 RtlZeroMemory(potm, Size);
1006 IntGetOutlineTextMetrics(FontGDI, Size, potm, FALSE);
1007
1008 _SEH2_TRY
1009 {
1010 ProbeForWrite(otm, Size, 1);
1011 RtlCopyMemory(otm, potm, Size);
1012 }
1014 {
1016 }
1017 _SEH2_END
1018
1019 if (!NT_SUCCESS(Status))
1020 {
1022 Size = 0;
1023 }
1024
1026 return Size;
1027}
1028
1029W32KAPI
1030BOOL
1033 IN LPWSTR pwszFiles,
1034 IN ULONG cwc,
1035 IN ULONG cFiles,
1036 IN UINT cjIn,
1038 OUT LPVOID pvBuf,
1039 IN DWORD dwType)
1040{
1042 DWORD dwBytes, dwBytesRequested;
1043 UNICODE_STRING SafeFileNames;
1044 BOOL bRet = FALSE;
1045 ULONG cbStringSize;
1046 LPVOID Buffer;
1047
1048 /* FIXME: Handle cFiles > 0 */
1049
1050 /* Check for valid dwType values */
1051 if (dwType > 5)
1052 {
1054 return FALSE;
1055 }
1056
1057 /* Allocate a safe unicode string buffer */
1058 cbStringSize = cwc * sizeof(WCHAR);
1059 SafeFileNames.MaximumLength = SafeFileNames.Length = (USHORT)cbStringSize - sizeof(WCHAR);
1060 SafeFileNames.Buffer = ExAllocatePoolWithTag(PagedPool,
1061 cbStringSize,
1062 TAG_USTR);
1063 if (!SafeFileNames.Buffer)
1064 {
1066 return FALSE;
1067 }
1068 RtlZeroMemory(SafeFileNames.Buffer, SafeFileNames.MaximumLength);
1069
1070 /* Check buffers and copy pwszFiles to safe unicode string */
1071 _SEH2_TRY
1072 {
1073 ProbeForRead(pwszFiles, cbStringSize, 1);
1074 ProbeForWrite(pdwBytes, sizeof(DWORD), 1);
1075 if (pvBuf)
1076 ProbeForWrite(pvBuf, cjIn, 1);
1077
1078 dwBytes = *pdwBytes;
1079 dwBytesRequested = dwBytes;
1080
1081 RtlCopyMemory(SafeFileNames.Buffer, pwszFiles, cbStringSize);
1082 if (dwBytes > 0)
1083 {
1085 }
1086 else
1087 {
1089 }
1090 }
1092 {
1094 }
1095 _SEH2_END
1096
1097 if(!NT_SUCCESS(Status))
1098 {
1100 /* Free the string buffer for the safe filename */
1101 ExFreePoolWithTag(SafeFileNames.Buffer, TAG_USTR);
1102 return FALSE;
1103 }
1104
1105 /* Do the actual call */
1106 bRet = IntGdiGetFontResourceInfo(&SafeFileNames,
1107 (pvBuf ? Buffer : NULL),
1108 &dwBytes, dwType);
1109
1110 /* Check if succeeded */
1111 if (bRet)
1112 {
1113 /* Copy the data back to caller */
1114 _SEH2_TRY
1115 {
1116 /* Buffers are already probed */
1117 if (pvBuf && dwBytesRequested > 0)
1118 RtlCopyMemory(pvBuf, Buffer, min(dwBytesRequested, dwBytes));
1119 *pdwBytes = dwBytes;
1120 }
1122 {
1124 }
1125 _SEH2_END
1126
1127 if(!NT_SUCCESS(Status))
1128 {
1130 bRet = FALSE;
1131 }
1132 }
1133
1135 /* Free the string for the safe filenames */
1136 ExFreePoolWithTag(SafeFileNames.Buffer, TAG_USTR);
1137
1138 return bRet;
1139}
1140
1141 /*
1142 * @unimplemented
1143 */
1144BOOL
1147 IN HDC hdc,
1149 IN HFONT hf)
1150{
1151 PDC pDc;
1152 PTEXTOBJ pTextObj;
1153 PFONTGDI pFontGdi;
1154 PDC_ATTR pdcattr;
1155 BOOL Ret = FALSE;
1156 INT i = 0;
1158
1159 pDc = DC_LockDc(hdc);
1160 if (!pDc)
1161 {
1163 return 0;
1164 }
1165 pdcattr = pDc->pdcattr;
1166 pTextObj = RealizeFontInit(pdcattr->hlfntNew);
1167 ASSERT(pTextObj != NULL);
1168 pFontGdi = ObjToGDI(pTextObj->Font, FONT);
1169 TEXTOBJ_UnlockText(pTextObj);
1170 DC_UnlockDc(pDc);
1171
1172 Ret = ftGdiRealizationInfo(pFontGdi, &ri);
1173 if (Ret)
1174 {
1175 if (pri)
1176 {
1178 _SEH2_TRY
1179 {
1180 ProbeForWrite(pri, sizeof(REALIZATION_INFO), 1);
1181 RtlCopyMemory(pri, &ri, sizeof(REALIZATION_INFO));
1182 }
1184 {
1186 }
1187 _SEH2_END
1188
1189 if(!NT_SUCCESS(Status))
1190 {
1192 return FALSE;
1193 }
1194 }
1195 do
1196 {
1197 if (GdiHandleTable->cfPublic[i].hf == hf)
1198 {
1199 GdiHandleTable->cfPublic[i].iTechnology = ri.iTechnology;
1200 GdiHandleTable->cfPublic[i].iUniq = ri.iUniq;
1201 GdiHandleTable->cfPublic[i].dwUnknown = ri.dwUnknown;
1202 GdiHandleTable->cfPublic[i].dwCFCount = GdiHandleTable->dwCFCount;
1203 GdiHandleTable->cfPublic[i].fl |= CFONT_REALIZATION;
1204 }
1205 i++;
1206 }
1207 while ( i < GDI_CFONT_MAX );
1208 }
1209 return Ret;
1210}
1211
1212
1213HFONT
1216 IN PENUMLOGFONTEXDVW pelfw,
1217 IN ULONG cjElfw,
1218 IN LFTYPE lft,
1219 IN FLONG fl,
1220 IN PVOID pvCliData )
1221{
1222 HFONT hNewFont;
1223 PLFONT plfont;
1224
1225 if (!pelfw)
1226 {
1227 return NULL;
1228 }
1229
1230 plfont = LFONT_AllocFontWithHandle();
1231 if (!plfont)
1232 {
1233 return NULL;
1234 }
1235 hNewFont = plfont->BaseObject.hHmgr;
1236
1237 plfont->lft = lft;
1238 plfont->fl = fl;
1239 RtlCopyMemory (&plfont->logfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
1240 ExInitializePushLock(&plfont->lock);
1241
1242 if (pelfw->elfEnumLogfontEx.elfLogFont.lfEscapement !=
1243 pelfw->elfEnumLogfontEx.elfLogFont.lfOrientation)
1244 {
1245 /* This should really depend on whether GM_ADVANCED is set */
1248 }
1249 LFONT_UnlockFont(plfont);
1250
1251 if (pvCliData && hNewFont)
1252 {
1253 // FIXME: Use GDIOBJ_InsertUserData
1255 {
1258 Entry->UserData = pvCliData;
1259 }
1261 }
1262
1263 return hNewFont;
1264}
1265
1266
1267HFONT
1270 IN PENUMLOGFONTEXDVW pelfw,
1271 IN ULONG cjElfw,
1272 IN LFTYPE lft,
1273 IN FLONG fl,
1274 IN PVOID pvCliData )
1275{
1276 ENUMLOGFONTEXDVW SafeLogfont;
1278
1279 /* Silence GCC warnings */
1282
1283 if (!pelfw)
1284 {
1285 return NULL;
1286 }
1287
1288 _SEH2_TRY
1289 {
1290 ProbeForRead(pelfw, sizeof(ENUMLOGFONTEXDVW), 1);
1291 RtlCopyMemory(&SafeLogfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
1292 }
1294 {
1296 }
1297 _SEH2_END
1298
1299 if (!NT_SUCCESS(Status))
1300 {
1301 return NULL;
1302 }
1303
1304 return HfontCreate(&SafeLogfont, cjElfw, lft, fl, pvCliData);
1305}
1306
1307
1308/* EOF */
static HDC hDC
Definition: 3dtext.c:33
INT APIENTRY NtGdiAddFontResourceW(_In_reads_(cwc) WCHAR *pwszFiles, _In_ ULONG cwc, _In_ ULONG cFiles, _In_ FLONG f, _In_ DWORD dwPidTid, _In_opt_ DESIGNVECTOR *pdv)
Definition: font.c:465
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
HFONT hFont
Definition: main.c:53
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
Definition: bufpool.h:45
HDC dc
Definition: cylfrac.c:34
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:238
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:220
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define TAG_USTR
Definition: libsupp.c:997
#define APIENTRY
Definition: api.h:79
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ObjToGDI(ClipObj, Type)
Definition: engobjects.h:184
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
#define ExInitializePushLock
Definition: ex.h:1016
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL FASTCALL TextIntUpdateSize(PDC dc, PTEXTOBJ TextObj, PFONTGDI FontGDI, BOOL bDoLock)
Definition: freetype.c:4302
DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI Font, DWORD cPairs, LPKERNINGPAIR pKerningPair)
Definition: freetype.c:6465
BOOL FASTCALL ftGdiGetTextMetricsW(HDC hDC, PTMW_INTERNAL ptmwi)
Definition: freetype.c:5348
BOOL FASTCALL IntGdiRemoveFontResource(_In_ PCUNICODE_STRING FileName, _In_ DWORD cFiles, _In_ DWORD dwFlags)
Definition: freetype.c:2338
BOOL FASTCALL TextIntGetTextExtentPoint(PDC dc, PTEXTOBJ TextObj, LPCWSTR String, INT Count, ULONG MaxExtent, LPINT Fit, LPINT Dx, LPSIZE Size, FLONG fl)
Definition: freetype.c:5039
BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING FileName, PVOID pBuffer, DWORD *pdwBytes, DWORD dwType)
Definition: freetype.c:6178
ULONG FASTCALL ftGdiGetGlyphOutline(PDC dc, WCHAR wch, UINT iFormat, LPGLYPHMETRICS pgm, ULONG cjBuf, PVOID pvBuf, LPMAT2 pmat2, BOOL bIgnoreRotation)
Definition: freetype.c:4511
DWORD FASTCALL ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset)
Definition: freetype.c:5274
INT FASTCALL IntGdiAddFontResourceEx(_In_ PCUNICODE_STRING FileName, _In_ DWORD cFiles, _In_ DWORD Characteristics, _In_ DWORD dwFlags)
Definition: freetype.c:2291
BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI Font, PREALIZATION_INFO Info)
Definition: freetype.c:6446
BOOL FASTCALL IntGdiRemoveFontMemResource(HANDLE hMMFont)
Definition: freetype.c:2622
NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj)
Definition: freetype.c:5988
HANDLE FASTCALL IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded)
Definition: freetype.c:2536
INT FASTCALL ftGdiGetTextCharsetInfo(PDC Dc, LPFONTSIGNATURE lpSig, DWORD dwFlags)
Definition: freetype.c:5161
DWORD FASTCALL ftGdiGetFontData(PFONTGDI FontGdi, DWORD Table, DWORD Offset, PVOID Buffer, DWORD Size)
Definition: freetype.c:5446
INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI FontGDI, UINT Size, OUTLINETEXTMETRICW *Otm, BOOL bLocked)
Definition: freetype.c:3149
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
Status
Definition: gdiplustypes.h:25
ASMGENDATA Table[]
Definition: genincdata.c:61
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:599
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
static PWSTR PDWORD pdwBytes
Definition: layerapi.c:35
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
HDC hdc
Definition: main.c:9
FORCEINLINE PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
Definition: precomp.h:45
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
#define _In_reads_(s)
Definition: no_sal2.h:168
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
int Count
Definition: noreturn.cpp:7
#define FASTCALL
Definition: nt_native.h:50
unsigned long FLONG
Definition: ntbasedef.h:374
#define UNICODE_NULL
#define UNICODE_STRING_MAX_CHARS
#define DBG_UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:326
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
__kernel_entry W32KAPI ULONG APIENTRY NtGdiGetKerningPairs(_In_ HDC hdc, _In_ ULONG cPairs, _Out_writes_to_opt_(cPairs, return) KERNINGPAIR *pkpDst)
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiAddFontMemResourceEx(_In_reads_bytes_(cjBuffer) PVOID pvBuffer, _In_ DWORD cjBuffer, _In_reads_bytes_opt_(cjDV) DESIGNVECTOR *pdv, _In_ ULONG cjDV, _Out_ DWORD *pNumFonts)
__kernel_entry W32KAPI ULONG APIENTRY NtGdiGetGlyphOutline(_In_ HDC hdc, _In_ WCHAR wch, _In_ UINT iFormat, _Out_ LPGLYPHMETRICS pgm, _In_ ULONG cjBuf, _Out_writes_bytes_opt_(cjBuf) PVOID pvBuf, _In_ LPMAT2 pmat2, _In_ BOOL bIgnoreRotation)
__kernel_entry W32KAPI ULONG APIENTRY NtGdiGetOutlineTextMetricsInternalW(_In_ HDC hdc, _In_ ULONG cjotm, _Out_writes_bytes_opt_(cjotm) OUTLINETEXTMETRICW *potmw, _Out_ TMDIFF *ptmd)
__kernel_entry W32KAPI HFONT APIENTRY NtGdiHfontCreate(_In_reads_bytes_(cjElfw) ENUMLOGFONTEXDVW *pelfw, _In_ ULONG cjElfw, _In_ LFTYPE lft, _In_ FLONG fl, _In_ PVOID pvCliData)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiRemoveFontResourceW(_In_reads_(cwc) WCHAR *pwszFiles, _In_ ULONG cwc, _In_ ULONG cFiles, _In_ ULONG fl, _In_ DWORD dwPidTid, _In_opt_ DESIGNVECTOR *pdv)
Definition: font.c:519
#define W32KAPI
Definition: ntgdi.h:9
_In_ ULONG cjBuffer
Definition: ntgdi.h:2860
__kernel_entry W32KAPI BOOL APIENTRY NtGdiRemoveFontMemResourceEx(_In_ HANDLE hMMFont)
__kernel_entry W32KAPI DWORD APIENTRY NtGdiGetCharacterPlacementW(_In_ HDC hdc, _In_reads_z_(nCount) LPWSTR pwsz, _In_ INT nCount, _In_ INT nMaxExtent, _Inout_ LPGCP_RESULTSW pgcpw, _In_ DWORD dwFlags)
#define GDI_CFONT_MAX
Definition: ntgdihdl.h:20
#define CFONT_REALIZATION
Definition: ntgdityp.h:430
DWORD LFTYPE
Definition: ntgdityp.h:189
#define TAG_STRING
Definition: oslist.h:22
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:181
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82
#define _SEH2_VOLATILE
Definition: pseh2_64.h:185
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:184
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
static void Exit(void)
Definition: sock.c:1330
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: polytest.cpp:41
base of all file and directory entries
Definition: entries.h:83
HANDLE hlfntNew
Definition: ntgdihdl.h:330
FLONG flTextAlign
Definition: ntgdihdl.h:324
DWORD dvNumAxes
Definition: wingdi.h:2769
FLONG flType
Definition: engobjects.h:142
Definition: gdi.h:2
Definition: text.h:60
LFTYPE lft
Definition: text.h:64
BASEOBJECT BaseObject
Definition: text.h:63
FLONG fl
Definition: text.h:65
ENUMLOGFONTEXDVW logfont
Definition: text.h:70
FONTOBJ * Font
Definition: text.h:66
EX_PUSH_LOCK lock
Definition: text.h:71
Definition: wingdi.h:2472
LONG cx
Definition: kdterminal.h:27
TEXTMETRICW TextMetric
Definition: ntgdityp.h:370
USHORT MaximumLength
Definition: env_spec_w32.h:370
DESIGNVECTOR elfDesignVector
Definition: wingdi.h:2780
ENUMLOGFONTEXW elfEnumLogfontEx
Definition: wingdi.h:2779
WCHAR elfStyle[LF_FACESIZE]
Definition: wingdi.h:2704
LOGFONTW elfLogFont
Definition: wingdi.h:2702
WCHAR elfFullName[LF_FULLFACESIZE]
Definition: wingdi.h:2703
WCHAR elfScript[LF_FACESIZE]
Definition: wingdi.h:2705
DWORD fsCsb[2]
Definition: wingdi.h:1543
INT * lpCaretPos
Definition: wingdi.h:2435
LPWSTR lpClass
Definition: wingdi.h:2436
LPWSTR lpOutString
Definition: wingdi.h:2432
UINT * lpOrder
Definition: wingdi.h:2433
LPWSTR lpGlyphs
Definition: wingdi.h:2437
LONG lfOrientation
Definition: wingdi.h:1900
LONG lfEscapement
Definition: wingdi.h:1899
LONG tmHeight
Definition: wingdi.h:2383
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define GdiHandleTable
Definition: win32nt.h:37
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31
W32KAPI BOOL APIENTRY NtGdiGetFontResourceInfoInternalW(IN LPWSTR pwszFiles, IN ULONG cwc, IN ULONG cFiles, IN UINT cjIn, IN OUT LPDWORD pdwBytes, OUT LPVOID pvBuf, IN DWORD dwType)
Definition: font.c:1032
DWORD FASTCALL IntGetFontLanguageInfo(PDC Dc)
Definition: font.c:371
DWORD APIENTRY NtGdiGetFontUnicodeRanges(IN HDC hdc, OUT OPTIONAL LPGLYPHSET pgs)
Definition: font.c:725
HFONT APIENTRY HfontCreate(IN PENUMLOGFONTEXDVW pelfw, IN ULONG cjElfw, IN LFTYPE lft, IN FLONG fl, IN PVOID pvCliData)
Definition: font.c:1215
DWORD FASTCALL IntGetCharDimensions(HDC hdc, PTEXTMETRICW ptm, PDWORD height)
Definition: font.c:329
DWORD FASTCALL GreGetKerningPairs(HDC hDC, ULONG NumPairs, LPKERNINGPAIR krnpair)
Definition: font.c:48
BOOL APIENTRY NtGdiGetRealizationInfo(IN HDC hdc, OUT PREALIZATION_INFO pri, IN HFONT hf)
Definition: font.c:1146
static BOOL IntCheckFontPathNames(_In_reads_(cwc) WCHAR *pwcFiles, _In_ ULONG cFiles, _In_ ULONG cwc)
Definition: font.c:442
HFONT FASTCALL GreCreateFontIndirectW(LOGFONTW *lplf)
Definition: font.c:23
ULONG FASTCALL FontGetObject(PTEXTOBJ plfont, ULONG cjBuffer, PVOID pvBuffer)
Definition: font.c:293
DWORD APIENTRY NtGdiGetFontData(HDC hDC, DWORD Table, DWORD Offset, LPVOID Buffer, DWORD Size)
Definition: font.c:663
PTEXTOBJ FASTCALL RealizeFontInit(HFONT hFont)
Definition: font.c:422
BOOL FASTCALL GreGetTextExtentW(HDC hDC, LPCWSTR lpwsz, INT cwc, LPSIZE psize, UINT flOpts)
Definition: text.c:78
BOOL FASTCALL GreGetTextExtentExW(HDC hDC, LPCWSTR String, ULONG Count, ULONG MaxExtent, PULONG Fit, PULONG Dx, LPSIZE pSize, FLONG fl)
Definition: text.c:135
#define TAG_FINF
Definition: text.h:3
#define LFONT_UnlockFont(plfnt)
Definition: text.h:79
FORCEINLINE PTEXTOBJ TEXTOBJ_LockText(HFONT hfont)
Definition: text.h:83
#define TEXTOBJECT_INIT
Definition: text.h:56
FORCEINLINE VOID TEXTOBJ_UnlockText(PLFONT plfnt)
Definition: text.h:96
#define LFONT_AllocFontWithHandle()
Definition: text.h:76
#define TAG_FONT
Definition: tags.h:12
#define GDITAG_TEXT
Definition: tags.h:172
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ FLONG fl
Definition: winddi.h:1279
_In_ DWORD cjBuf
Definition: winddi.h:3827
#define FO_TYPE_TRUETYPE
Definition: winddi.h:737
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR * pdv
Definition: winddi.h:3723
_In_ SIZEL _In_ ULONG iFormat
Definition: winddi.h:3468
_In_ ULONG _In_ CLIPOBJ _In_ RECTL _In_ ULONG cjIn
Definition: winddi.h:3532
#define GCP_GLYPHSHAPE
Definition: wingdi.h:833
#define GCP_DIACRITIC
Definition: wingdi.h:831
#define GCP_LIGATE
Definition: wingdi.h:837
#define GCPCLASS_LATIN
Definition: wingdi.h:670
#define GCP_MAXEXTENT
Definition: wingdi.h:838
#define GCP_USEKERNING
Definition: wingdi.h:845
#define GCP_KASHIDA
Definition: wingdi.h:836
#define FLI_GLYPHS
Definition: wingdi.h:846
#define TA_RTLREADING
Definition: wingdi.h:934
#define GDI_ERROR
Definition: wingdi.h:1309
#define GCP_REORDER
Definition: wingdi.h:843
#define GCP_DBCS
Definition: wingdi.h:828
#define GCP_JUSTIFY
Definition: wingdi.h:834
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
#define ExAllocatePoolWithQuotaTag(a, b, c)
Definition: exfuncs.h:530
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193