summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-07-30 16:28:45 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-07-30 16:31:44 -0400
commit2ea66938b387b3d492e45f6277666258366cf003 (patch)
tree8965492a9b715542e2ffabc6f8100047892a583e
parent112f0d741a24237e83922f8eee735b7f1ae74019 (diff)
downloadpango-2ea66938b387b3d492e45f6277666258366cf003.tar.gz
[HB] Remove hinting setting and use ppem==0 to mean "no hinting"
-rw-r--r--pango/opentype/hb-blob.h3
-rw-r--r--pango/opentype/hb-common.h9
-rw-r--r--pango/opentype/hb-ot-layout-gpos-private.h36
-rw-r--r--pango/opentype/hb-ot-layout-private.h2
-rw-r--r--pango/opentype/hb-ot-layout.cc7
-rw-r--r--pango/opentype/hb-ot-layout.h4
-rw-r--r--pango/pango-ot-info.c12
7 files changed, 40 insertions, 33 deletions
diff --git a/pango/opentype/hb-blob.h b/pango/opentype/hb-blob.h
index 6cb7c34b..1066821c 100644
--- a/pango/opentype/hb-blob.h
+++ b/pango/opentype/hb-blob.h
@@ -31,9 +31,6 @@
HB_BEGIN_DECLS
-typedef struct _hb_blob_t hb_blob_t;
-typedef void (*hb_destroy_func_t) (void *user_data);
-
typedef enum {
HB_MEMORY_MODE_DUPLICATE,
HB_MEMORY_MODE_READONLY,
diff --git a/pango/opentype/hb-common.h b/pango/opentype/hb-common.h
index fab0cf4c..c719d803 100644
--- a/pango/opentype/hb-common.h
+++ b/pango/opentype/hb-common.h
@@ -50,4 +50,13 @@ typedef uint32_t hb_codepoint_t;
typedef int32_t hb_position_t;
typedef int32_t hb_16dot16_t;
+typedef struct _hb_blob_t hb_blob_t;
+typedef void (*hb_destroy_func_t) (void *user_data);
+
+typedef struct _hb_font_callbacks_t hb_font_callbacks_t;
+typedef struct _hb_unicode_callbacks_t hb_unicode_callbacks_t;
+
+typedef struct _hb_face_t hb_face_t;
+typedef struct _hb_font_t hb_font_t;
+
#endif /* HB_COMMON_H */
diff --git a/pango/opentype/hb-ot-layout-gpos-private.h b/pango/opentype/hb-ot-layout-gpos-private.h
index 619b4c47..b0695c1a 100644
--- a/pango/opentype/hb-ot-layout-gpos-private.h
+++ b/pango/opentype/hb-ot-layout-gpos-private.h
@@ -109,19 +109,32 @@ struct ValueRecord {
if (format & yAdvance)
glyph_pos->y_advance += y_scale * *(SHORT*)values++ / 0x10000;
- if (HB_LIKELY (!layout->gpos_info.dvi))
- {
- x_ppem = layout->gpos_info.x_ppem;
- y_ppem = layout->gpos_info.y_ppem;
- /* pixel -> fractional pixel */
- if (format & xPlaDevice)
+ x_ppem = layout->gpos_info.x_ppem;
+ y_ppem = layout->gpos_info.y_ppem;
+ /* pixel -> fractional pixel */
+ if (format & xPlaDevice) {
+ if (x_ppem)
glyph_pos->x_pos += (base+*(OffsetTo<Device>*)values++).get_delta (x_ppem) << 6;
- if (format & yPlaDevice)
+ else
+ values++;
+ }
+ if (format & yPlaDevice) {
+ if (y_ppem)
glyph_pos->y_pos += (base+*(OffsetTo<Device>*)values++).get_delta (y_ppem) << 6;
- if (format & xAdvDevice)
+ else
+ values++;
+ }
+ if (format & xAdvDevice) {
+ if (x_ppem)
glyph_pos->x_advance += (base+*(OffsetTo<Device>*)values++).get_delta (x_ppem) << 6;
- if (format & yAdvDevice)
+ else
+ values++;
+ }
+ if (format & yAdvDevice) {
+ if (y_ppem)
glyph_pos->y_advance += (base+*(OffsetTo<Device>*)values++).get_delta (y_ppem) << 6;
+ else
+ values++;
}
}
};
@@ -179,11 +192,10 @@ struct AnchorFormat3
*x = layout->gpos_info.x_scale * xCoordinate / 0x10000;
*y = layout->gpos_info.y_scale * yCoordinate / 0x10000;
- if (!layout->gpos_info.dvi)
- {
+ if (layout->gpos_info.x_ppem)
*x += (this+xDeviceTable).get_delta (layout->gpos_info.x_ppem) << 6;
+ if (layout->gpos_info.y_ppem)
*y += (this+yDeviceTable).get_delta (layout->gpos_info.y_ppem) << 6;
- }
}
private:
diff --git a/pango/opentype/hb-ot-layout-private.h b/pango/opentype/hb-ot-layout-private.h
index 12b1ee1c..1ce32eda 100644
--- a/pango/opentype/hb-ot-layout-private.h
+++ b/pango/opentype/hb-ot-layout-private.h
@@ -51,8 +51,6 @@ struct _hb_ot_layout_t
unsigned int x_ppem, y_ppem;
hb_16dot16_t x_scale, y_scale;
- hb_bool_t dvi;
-
unsigned int last; /* the last valid glyph--used with cursive positioning */
hb_position_t anchor_x; /* the coordinates of the anchor point */
hb_position_t anchor_y; /* of the last valid glyph */
diff --git a/pango/opentype/hb-ot-layout.cc b/pango/opentype/hb-ot-layout.cc
index c99e8eaa..d101340d 100644
--- a/pango/opentype/hb-ot-layout.cc
+++ b/pango/opentype/hb-ot-layout.cc
@@ -115,13 +115,6 @@ hb_ot_layout_destroy (hb_ot_layout_t *layout)
}
void
-hb_ot_layout_set_hinting (hb_ot_layout_t *layout,
- hb_bool_t hinted)
-{
- layout->gpos_info.dvi = !hinted;
-}
-
-void
hb_ot_layout_set_scale (hb_ot_layout_t *layout,
hb_16dot16_t x_scale, hb_16dot16_t y_scale)
{
diff --git a/pango/opentype/hb-ot-layout.h b/pango/opentype/hb-ot-layout.h
index f1b4b45e..d19f558a 100644
--- a/pango/opentype/hb-ot-layout.h
+++ b/pango/opentype/hb-ot-layout.h
@@ -54,10 +54,6 @@ void
hb_ot_layout_destroy (hb_ot_layout_t *layout);
void
-hb_ot_layout_set_hinting (hb_ot_layout_t *layout,
- hb_bool_t hinted);
-
-void
hb_ot_layout_set_scale (hb_ot_layout_t *layout,
hb_16dot16_t x_scale, hb_16dot16_t y_scale);
diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c
index 2a2c1470..6b3a9be5 100644
--- a/pango/pango-ot-info.c
+++ b/pango/pango-ot-info.c
@@ -558,14 +558,16 @@ _pango_ot_info_position (const PangoOTInfo *info,
/* XXX */
_hb_buffer_clear_positions (buffer->buffer);
- hb_ot_layout_set_hinting (info->layout,
- buffer->font->is_hinted);
hb_ot_layout_set_scale (info->layout,
info->face->size->metrics.x_scale,
info->face->size->metrics.y_scale);
- hb_ot_layout_set_ppem (info->layout,
- info->face->size->metrics.x_ppem,
- info->face->size->metrics.y_ppem);
+
+ if (buffer->font->is_hinted)
+ hb_ot_layout_set_ppem (info->layout,
+ info->face->size->metrics.x_ppem,
+ info->face->size->metrics.y_ppem);
+ else
+ hb_ot_layout_set_ppem (info->layout, 0, 0);
for (i = 0; i < ruleset->rules->len; i++)
{