summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-gdi.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-gdi.cc')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-gdi.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-gdi.cc b/src/3rdparty/harfbuzz-ng/src/hb-gdi.cc
index f6306ef89f..8e7589beac 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-gdi.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-gdi.cc
@@ -28,6 +28,16 @@
#include "hb-gdi.h"
+
+/**
+ * SECTION:hb-gdi
+ * @title: hb-gdi
+ * @short_description: GDI integration
+ * @include: hb-gdi.h
+ *
+ * Functions for using HarfBuzz with GDI fonts.
+ **/
+
static hb_blob_t *
_hb_gdi_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data)
{
@@ -40,16 +50,16 @@ _hb_gdi_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_dat
length = GetFontData (hdc, hb_uint32_swap (tag), 0, buffer, length);
if (unlikely (length == GDI_ERROR)) goto fail_with_releasedc;
- buffer = (char *) malloc (length);
+ buffer = (char *) hb_malloc (length);
if (unlikely (!buffer)) goto fail_with_releasedc;
length = GetFontData (hdc, hb_uint32_swap (tag), 0, buffer, length);
if (unlikely (length == GDI_ERROR)) goto fail_with_releasedc_and_free;
ReleaseDC (nullptr, hdc);
- return hb_blob_create ((const char *) buffer, length, HB_MEMORY_MODE_WRITABLE, buffer, free);
+ return hb_blob_create ((const char *) buffer, length, HB_MEMORY_MODE_WRITABLE, buffer, hb_free);
fail_with_releasedc_and_free:
- free (buffer);
+ hb_free (buffer);
fail_with_releasedc:
ReleaseDC (nullptr, hdc);
fail:
@@ -60,6 +70,8 @@ fail:
* hb_gdi_face_create:
* @hfont: a HFONT object.
*
+ * Constructs a new face object from the specified GDI HFONT.
+ *
* Return value: #hb_face_t object corresponding to the given input
*
* Since: 2.6.0