3 #include "gdipp_server/os2_metrics.h"
8 #define buf_family_name(metric_buf) (reinterpret_cast<const wchar_t *>(metric_buf + reinterpret_cast<const UINT>((reinterpret_cast<const OUTLINETEXTMETRICW *>(metric_buf)->otmpFamilyName))))
9 #define buf_face_name(metric_buf) (reinterpret_cast<const wchar_t *>(metric_buf + reinterpret_cast<const UINT>((reinterpret_cast<const OUTLINETEXTMETRICW *>(metric_buf)->otmpFaceName))))
10 #define buf_style_name(metric_buf) (reinterpret_cast<const wchar_t *>(metric_buf + reinterpret_cast<const UINT>((reinterpret_cast<const OUTLINETEXTMETRICW *>(metric_buf)->otmpStyleName))))
11 #define metric_family_name(outline_metric) (reinterpret_cast<const wchar_t *>(reinterpret_cast<const BYTE *>(outline_metric) + reinterpret_cast<const UINT>(outline_metric->otmpFamilyName)))
12 #define metric_face_name(outline_metric) (reinterpret_cast<const wchar_t *>(reinterpret_cast<const BYTE *>(outline_metric) + reinterpret_cast<const UINT>(outline_metric->otmpFaceName)))
13 #define metric_style_name(outline_metric) (reinterpret_cast<const wchar_t *>(reinterpret_cast<const BYTE *>(outline_metric) + reinterpret_cast<const UINT>(outline_metric->otmpStyleName)))
18 static DWORD
get_font_size(HDC font_holder
, DWORD
*table_header
);
19 static ULONG
get_ttc_face_index(HDC font_holder
, DWORD ttc_file_size
);
24 void *register_font(HDC font_holder
, const LOGFONTW
*log_font
, BYTE
**outline_metrics_buf
, unsigned long *outline_metrics_size
);
25 HFONT
select_font(void *font_id
, HDC hdc
) const;
27 ULONG
lookup_face_index(void *font_id
) const;
28 const os2_metrics
*lookup_os2_metrics(void *font_id
) const;
29 FT_Stream
lookup_stream(void *font_id
) const;
31 HDC
get_thread_font_holder() const;
32 BOOL
set_thread_font_holder(HDC font_holder
) const;
37 // all fields are font-specific and thread-safe invariants
43 // used to retrieve font data from GetFontData
48 static unsigned long get_dc_outline_metrics(HDC hdc
, BYTE
**outline_metrics_buf
);
49 static unsigned long stream_io(FT_Stream stream
, unsigned long offset
, unsigned char *buffer
, unsigned long count
);
50 static void stream_close(FT_Stream stream
);
52 std::map
<std::wstring
, _font_entry
> _font_registry
;
53 DWORD _font_holder_tls_index
;