[HB] Remove hinting setting and use ppem==0 to mean "no hinting"
This commit is contained in:
parent
f0954d1e08
commit
0090dc0f67
|
@ -31,9 +31,6 @@
|
||||||
|
|
||||||
HB_BEGIN_DECLS
|
HB_BEGIN_DECLS
|
||||||
|
|
||||||
typedef struct _hb_blob_t hb_blob_t;
|
|
||||||
typedef void (*hb_destroy_func_t) (void *user_data);
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
HB_MEMORY_MODE_DUPLICATE,
|
HB_MEMORY_MODE_DUPLICATE,
|
||||||
HB_MEMORY_MODE_READONLY,
|
HB_MEMORY_MODE_READONLY,
|
||||||
|
|
|
@ -50,4 +50,13 @@ typedef uint32_t hb_codepoint_t;
|
||||||
typedef int32_t hb_position_t;
|
typedef int32_t hb_position_t;
|
||||||
typedef int32_t hb_16dot16_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 */
|
#endif /* HB_COMMON_H */
|
||||||
|
|
|
@ -109,19 +109,32 @@ struct ValueRecord {
|
||||||
if (format & yAdvance)
|
if (format & yAdvance)
|
||||||
glyph_pos->y_advance += y_scale * *(SHORT*)values++ / 0x10000;
|
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;
|
||||||
x_ppem = layout->gpos_info.x_ppem;
|
/* pixel -> fractional pixel */
|
||||||
y_ppem = layout->gpos_info.y_ppem;
|
if (format & xPlaDevice) {
|
||||||
/* pixel -> fractional pixel */
|
if (x_ppem)
|
||||||
if (format & xPlaDevice)
|
|
||||||
glyph_pos->x_pos += (base+*(OffsetTo<Device>*)values++).get_delta (x_ppem) << 6;
|
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;
|
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;
|
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;
|
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;
|
*x = layout->gpos_info.x_scale * xCoordinate / 0x10000;
|
||||||
*y = layout->gpos_info.y_scale * yCoordinate / 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;
|
*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;
|
*y += (this+yDeviceTable).get_delta (layout->gpos_info.y_ppem) << 6;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -51,8 +51,6 @@ struct _hb_ot_layout_t
|
||||||
unsigned int x_ppem, y_ppem;
|
unsigned int x_ppem, y_ppem;
|
||||||
hb_16dot16_t x_scale, y_scale;
|
hb_16dot16_t x_scale, y_scale;
|
||||||
|
|
||||||
hb_bool_t dvi;
|
|
||||||
|
|
||||||
unsigned int last; /* the last valid glyph--used with cursive positioning */
|
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_x; /* the coordinates of the anchor point */
|
||||||
hb_position_t anchor_y; /* of the last valid glyph */
|
hb_position_t anchor_y; /* of the last valid glyph */
|
||||||
|
|
|
@ -114,13 +114,6 @@ hb_ot_layout_destroy (hb_ot_layout_t *layout)
|
||||||
free (layout);
|
free (layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
hb_ot_layout_set_hinting (hb_ot_layout_t *layout,
|
|
||||||
hb_bool_t hinted)
|
|
||||||
{
|
|
||||||
layout->gpos_info.dvi = !hinted;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
hb_ot_layout_set_scale (hb_ot_layout_t *layout,
|
hb_ot_layout_set_scale (hb_ot_layout_t *layout,
|
||||||
hb_16dot16_t x_scale, hb_16dot16_t y_scale)
|
hb_16dot16_t x_scale, hb_16dot16_t y_scale)
|
||||||
|
|
|
@ -53,10 +53,6 @@ hb_ot_layout_create_for_tables (const char *gdef_data,
|
||||||
void
|
void
|
||||||
hb_ot_layout_destroy (hb_ot_layout_t *layout);
|
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
|
void
|
||||||
hb_ot_layout_set_scale (hb_ot_layout_t *layout,
|
hb_ot_layout_set_scale (hb_ot_layout_t *layout,
|
||||||
hb_16dot16_t x_scale, hb_16dot16_t y_scale);
|
hb_16dot16_t x_scale, hb_16dot16_t y_scale);
|
||||||
|
|
Loading…
Reference in New Issue