2 Port from c++ is protected by a GNU Lesser GPLv3
3 Copyright © 2013 Sylvain BERTRAND <sylvain.bertrand@gmail.com>
7 #include "hb-private.h"
8 #include "hb-atomic-private.h"
9 #include "hb-buffer-private.h"
10 #include "hb-shaper-private.h"
11 #include "hb-font-private.h"
12 #include "hb-unicode-private.h"
14 /*----------------------------------------------------------------------------*/
16 struct hb_fallback_shaper_face_data_t
{
20 struct hb_fallback_shaper_face_data_t
21 *hb_fallback_shaper_face_data_create(hb_face_t
* face HB_UNUSED
)
23 return HB_SHAPER_DATA_SUCCEEDED
;
27 hb_fallback_shaper_face_data_destroy(struct hb_fallback_shaper_face_data_t
*data
32 /*----------------------------------------------------------------------------*/
34 /*----------------------------------------------------------------------------*/
36 struct hb_fallback_shaper_font_data_t
{
40 struct hb_fallback_shaper_font_data_t
41 *hb_fallback_shaper_font_data_create(hb_font_t
* font HB_UNUSED
)
43 return HB_SHAPER_DATA_SUCCEEDED
;
46 void hb_fallback_shaper_font_data_destroy(struct hb_fallback_shaper_font_data_t
51 /*----------------------------------------------------------------------------*/
53 /*----------------------------------------------------------------------------*/
54 /*shaper shape_plan data*/
55 struct hb_fallback_shaper_shape_plan_data_t
{
59 struct hb_fallback_shaper_shape_plan_data_t
60 *hb_fallback_shaper_shape_plan_data_create(hb_shape_plan_t
*
63 user_features HB_UNUSED
,
64 unsigned num_user_features HB_UNUSED
)
66 return HB_SHAPER_DATA_SUCCEEDED
;
69 void hb_fallback_shaper_shape_plan_data_destroy(struct
70 hb_fallback_shaper_shape_plan_data_t
75 /*----------------------------------------------------------------------------*/
78 hb_bool_t
hb_fallback_shape(hb_shape_plan_t
* shape_plan HB_UNUSED
,
79 hb_font_t
* font
, hb_buffer_t
* buffer
,
80 const hb_feature_t
* features HB_UNUSED
,
81 unsigned num_features HB_UNUSED
)
87 hb_font_get_glyph(font
, ' ', 0, &space
);
89 hb_buffer_clear_positions(buffer
);
93 for (i
= 0; i
< count
; ++i
) {
94 if (hb_unicode_is_default_ignorable(buffer
->info
[i
].codepoint
)) {
95 buffer
->info
[i
].codepoint
= space
;
96 buffer
->pos
[i
].x_advance
= 0;
97 buffer
->pos
[i
].y_advance
= 0;
100 hb_font_get_glyph(font
, buffer
->info
[i
].codepoint
, 0,
101 &buffer
->info
[i
].codepoint
);
102 hb_font_get_glyph_advance_for_direction(font
,
105 buffer
->props
.direction
,
110 hb_font_subtract_glyph_origin_for_direction(font
,
121 if (HB_DIRECTION_IS_BACKWARD(buffer
->props
.direction
))
122 hb_buffer_reverse(buffer
);