Imported Upstream version 3.4.0
[platform/upstream/harfbuzz.git] / src / hb-gdi.cc
index f6306ef..8e7589b 100644 (file)
 
 #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