[ot-font] Rename
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 11 Sep 2018 10:56:17 +0000 (12:56 +0200)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 11 Sep 2018 10:57:41 +0000 (12:57 +0200)
src/hb-ot-font.cc

index 86aeb41..faacecb 100644 (file)
@@ -47,8 +47,8 @@ hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED,
                         hb_codepoint_t *glyph,
                         void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  return ot_font->cmap.get_relaxed()->get_nominal_glyph (unicode, glyph);
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  return ot_face->cmap.get_relaxed()->get_nominal_glyph (unicode, glyph);
 }
 
 static hb_bool_t
@@ -59,8 +59,8 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED,
                           hb_codepoint_t *glyph,
                           void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  return ot_font->cmap.get_relaxed ()->get_variation_glyph (unicode, variation_selector, glyph);
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  return ot_face->cmap.get_relaxed ()->get_variation_glyph (unicode, variation_selector, glyph);
 }
 
 static hb_position_t
@@ -69,8 +69,8 @@ hb_ot_get_glyph_h_advance (hb_font_t *font,
                           hb_codepoint_t glyph,
                           void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  return font->em_scale_x (ot_font->hmtx.get_relaxed ()->get_advance (glyph, font));
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  return font->em_scale_x (ot_face->hmtx.get_relaxed ()->get_advance (glyph, font));
 }
 
 static void
@@ -82,8 +82,8 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data,
                            unsigned advance_stride,
                            void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  const OT::hmtx_accelerator_t &hmtx = *ot_font->hmtx.get_relaxed ();
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx.get_relaxed ();
 
   for (unsigned int i = 0; i < count; i++)
   {
@@ -99,8 +99,8 @@ hb_ot_get_glyph_v_advance (hb_font_t *font,
                           hb_codepoint_t glyph,
                           void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  return font->em_scale_y (-(int) ot_font->vmtx.get_relaxed ()->get_advance (glyph, font));
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  return font->em_scale_y (-(int) ot_face->vmtx.get_relaxed ()->get_advance (glyph, font));
 }
 
 static void
@@ -112,8 +112,8 @@ hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data,
                            unsigned advance_stride,
                            void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  const OT::vmtx_accelerator_t &vmtx = *ot_font->vmtx.get_relaxed ();
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx.get_relaxed ();
 
   for (unsigned int i = 0; i < count; i++)
   {
@@ -130,8 +130,8 @@ hb_ot_get_glyph_h_kerning (hb_font_t *font,
                           hb_codepoint_t right_glyph,
                           void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  return font->em_scale_x (ot_font->kern->get_h_kerning (left_glyph, right_glyph));
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  return font->em_scale_x (ot_face->kern->get_h_kerning (left_glyph, right_glyph));
 }
 
 static hb_bool_t
@@ -141,10 +141,10 @@ hb_ot_get_glyph_extents (hb_font_t *font,
                         hb_glyph_extents_t *extents,
                         void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  bool ret = ot_font->glyf->get_extents (glyph, extents);
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  bool ret = ot_face->glyf->get_extents (glyph, extents);
   if (!ret)
-    ret = ot_font->CBDT->get_extents (glyph, extents);
+    ret = ot_face->CBDT->get_extents (glyph, extents);
   // TODO Hook up side-bearings variations.
   extents->x_bearing = font->em_scale_x (extents->x_bearing);
   extents->y_bearing = font->em_scale_y (extents->y_bearing);
@@ -160,8 +160,8 @@ hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED,
                       char *name, unsigned int size,
                       void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  return ot_font->post->get_glyph_name (glyph, name, size);
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  return ot_face->post->get_glyph_name (glyph, name, size);
 }
 
 static hb_bool_t
@@ -171,8 +171,8 @@ hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED,
                            hb_codepoint_t *glyph,
                            void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  return ot_font->post->get_glyph_from_name (name, len, glyph);
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  return ot_face->post->get_glyph_from_name (name, len, glyph);
 }
 
 static hb_bool_t
@@ -181,12 +181,12 @@ hb_ot_get_font_h_extents (hb_font_t *font,
                          hb_font_extents_t *metrics,
                          void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  metrics->ascender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->ascender);
-  metrics->descender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->descender);
-  metrics->line_gap = font->em_scale_y (ot_font->hmtx.get_relaxed ()->line_gap);
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  metrics->ascender = font->em_scale_y (ot_face->hmtx.get_relaxed ()->ascender);
+  metrics->descender = font->em_scale_y (ot_face->hmtx.get_relaxed ()->descender);
+  metrics->line_gap = font->em_scale_y (ot_face->hmtx.get_relaxed ()->line_gap);
   // TODO Hook up variations.
-  return ot_font->hmtx.get_relaxed ()->has_font_extents;
+  return ot_face->hmtx.get_relaxed ()->has_font_extents;
 }
 
 static hb_bool_t
@@ -195,19 +195,19 @@ hb_ot_get_font_v_extents (hb_font_t *font,
                          hb_font_extents_t *metrics,
                          void *user_data HB_UNUSED)
 {
-  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
-  metrics->ascender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->ascender);
-  metrics->descender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->descender);
-  metrics->line_gap = font->em_scale_x (ot_font->vmtx.get_relaxed ()->line_gap);
+  const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+  metrics->ascender = font->em_scale_x (ot_face->vmtx.get_relaxed ()->ascender);
+  metrics->descender = font->em_scale_x (ot_face->vmtx.get_relaxed ()->descender);
+  metrics->line_gap = font->em_scale_x (ot_face->vmtx.get_relaxed ()->line_gap);
   // TODO Hook up variations.
-  return ot_font->vmtx.get_relaxed ()->has_font_extents;
+  return ot_face->vmtx.get_relaxed ()->has_font_extents;
 }
 
 #ifdef HB_USE_ATEXIT
 static void free_static_ot_funcs (void);
 #endif
 
-static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot_font_funcs_lazy_loader_t>
+static struct hb_ot_face_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot_face_funcs_lazy_loader_t>
 {
   static inline hb_font_funcs_t *create (void)
   {
@@ -264,15 +264,15 @@ void
 hb_ot_font_set_funcs (hb_font_t *font)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (font->face))) return;
-  hb_ot_face_data_t *ot_font = hb_ot_face_data (font->face);
+  hb_ot_face_data_t *ot_face = hb_ot_face_data (font->face);
 
   /* Load them lazies.  We access them with get_relaxed() for performance. */
-  ot_font->cmap.get ();
-  ot_font->hmtx.get ();
-  ot_font->vmtx.get ();
+  ot_face->cmap.get ();
+  ot_face->hmtx.get ();
+  ot_face->vmtx.get ();
 
   hb_font_set_funcs (font,
                     _hb_ot_get_font_funcs (),
-                    ot_font,
+                    ot_face,
                     nullptr);
 }