Add uniscribe font getters
diff --git a/src/hb-uniscribe-shape.cc b/src/hb-uniscribe-shape.cc
index 601e01c..a222fdf 100644
--- a/src/hb-uniscribe-shape.cc
+++ b/src/hb-uniscribe-shape.cc
@@ -146,6 +146,7 @@
static struct hb_uniscribe_font_data_t {
HDC hdc;
+ LOGFONTW log_font;
HFONT hfont;
SCRIPT_CACHE script_cache;
} _hb_uniscribe_font_data_nil = {NULL, NULL, NULL};
@@ -176,11 +177,10 @@
data->hdc = GetDC (NULL);
- LOGFONTW log_font;
- if (unlikely (!populate_log_font (&log_font, data->hdc, font)))
+ if (unlikely (!populate_log_font (&data->log_font, data->hdc, font)))
DEBUG_MSG (UNISCRIBE, font, "Font populate_log_font() failed");
else {
- data->hfont = CreateFontIndirectW (&log_font);
+ data->hfont = CreateFontIndirectW (&data->log_font);
if (unlikely (!data->hfont))
DEBUG_MSG (UNISCRIBE, font, "Font CreateFontIndirectW() failed");
if (!SelectObject (data->hdc, data->hfont))
@@ -202,6 +202,24 @@
return data;
}
+LOGFONTW *
+hb_uniscribe_font_get_logfontw (hb_font_t *font)
+{
+ hb_uniscribe_font_data_t *font_data = _hb_uniscribe_font_get_data (font);
+ if (unlikely (!font_data))
+ return NULL;
+ return &font_data->log_font;
+}
+
+HFONT
+hb_uniscribe_font_get_hfont (hb_font_t *font)
+{
+ hb_uniscribe_font_data_t *font_data = _hb_uniscribe_font_get_data (font);
+ if (unlikely (!font_data))
+ return 0;
+ return font_data->hfont;
+}
+
hb_bool_t
hb_uniscribe_shape (hb_font_t *font,
diff --git a/src/hb-uniscribe.h b/src/hb-uniscribe.h
index bbb4635..dbcacd7 100644
--- a/src/hb-uniscribe.h
+++ b/src/hb-uniscribe.h
@@ -30,6 +30,8 @@
#include "hb-common.h"
#include "hb-shape.h"
+#define _WIN32_WINNT 0x0500
+#include <windows.h>
HB_BEGIN_DECLS
@@ -41,6 +43,12 @@
unsigned int num_features,
const char * const *shaper_options);
+LOGFONTW *
+hb_uniscribe_font_get_logfontw (hb_font_t *font);
+
+HFONT
+hb_uniscribe_font_get_hfont (hb_font_t *font);
+
HB_END_DECLS