if (!str || !len || !*str)
return HB_LANGUAGE_INVALID;
- char strbuf[32];
if (len >= 0) {
+ char strbuf[64];
len = MIN (len, (int) sizeof (strbuf) - 1);
str = (char *) memcpy (strbuf, str, len);
strbuf[len] = '\0';
unsigned int num_features)
{
hb_face_t *face = font->face;
- hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
hb_coretext_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
#define FAIL(...) \
CFArrayRef glyph_runs = CTLineGetGlyphRuns (line);
unsigned int num_runs = CFArrayGetCount (glyph_runs);
- bool success = true;
buffer->len = 0;
const CFRange range_all = CFRangeMake (0, 0);
double advance = (j + 1 < num_glyphs ? positions[j + 1].x : positions[0].x + run_width) - positions[j].x;
hb_glyph_info_t *info = &buffer->info[buffer->len];
- hb_glyph_position_t *pos = &buffer->pos[buffer->len];
info->codepoint = glyphs[j];
info->cluster = string_indices[j];
hb_direction_t direction,
hb_position_t *x, hb_position_t *y)
{
- if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) {
- hb_bool_t ret = get_glyph_h_origin (glyph, x, y);
- if (!ret && (ret = get_glyph_v_origin (glyph, x, y))) {
+ if (likely (HB_DIRECTION_IS_HORIZONTAL (direction)))
+ {
+ if (!get_glyph_h_origin (glyph, x, y) &&
+ get_glyph_v_origin (glyph, x, y))
+ {
hb_position_t dx, dy;
guess_v_origin_minus_h_origin (glyph, &dx, &dy);
*x -= dx; *y -= dy;
}
- } else {
- hb_bool_t ret = get_glyph_v_origin (glyph, x, y);
- if (!ret && (ret = get_glyph_h_origin (glyph, x, y))) {
+ }
+ else
+ {
+ if (!get_glyph_v_origin (glyph, x, y) &&
+ get_glyph_h_origin (glyph, x, y))
+ {
hb_position_t dx, dy;
guess_v_origin_minus_h_origin (glyph, &dx, &dy);
*x += dx; *y += dy;
#define ULBAR "\342\225\257" /* U+256F BOX DRAWINGS LIGHT ARC UP AND LEFT */
#define LBAR "\342\225\264" /* U+2574 BOX DRAWINGS LIGHT LEFT */
static const char bars[] = VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR;
- fprintf (stderr, "%2d %s" VRBAR "%s",
+ fprintf (stderr, "%2u %s" VRBAR "%s",
level,
bars + sizeof (bars) - 1 - MIN ((unsigned int) sizeof (bars), (unsigned int) (sizeof (VBAR) - 1) * level),
level_dir ? (level_dir > 0 ? DLBAR : ULBAR) : LBAR);
assert (len < ARRAY_LENGTH (s));
len = MIN (len, size - 1);
memcpy (buf, s, len);
- s[len] = '\0';
+ buf[len] = '\0';
}
g_assert (!hb_font_get_glyph (font, 17, 2, &glyph));
g_assert_cmpint (glyph, ==, 0);
- x = 13;
x = hb_font_get_glyph_h_kerning (font, 17, 19);
g_assert_cmpint (x, ==, 0);
}
biimage_t (unsigned int width, unsigned int height) :
width (width),
height (height),
+ bg (0), fg (0), unicolor (true),
data ((uint8_t *) malloc (sizeof (data[0]) * width * height)) {}
~biimage_t (void)
{ free (data); }
first = false;
else
printf (" ");
- char glyph_name[32];
- if (show_glyph_names) {
+ if (show_glyph_names)
+ {
+ char glyph_name[64];
hb_font_get_glyph_name (font, i, glyph_name, sizeof (glyph_name));
printf ("%s", glyph_name);
} else
output_buffer_t (option_parser_t *parser)
: options (parser,
g_strjoinv ("/", (gchar**) hb_buffer_serialize_list_formats ())),
- format (parser) {}
+ format (parser),
+ gs (NULL),
+ line_no (0),
+ font (NULL) {}
void init (const font_options_t *font_opts)
{
struct shape_consumer_t
{
shape_consumer_t (option_parser_t *parser)
- : shaper (parser),
- output (parser) {}
+ : failed (false),
+ shaper (parser),
+ output (parser),
+ font (NULL) {}
void init (const font_options_t *font_opts)
{
#define VIEW_CAIRO_HH
-struct view_cairo_t {
+struct view_cairo_t
+{
view_cairo_t (option_parser_t *parser)
: output_options (parser, helper_cairo_supported_formats),
- view_options (parser) {}
+ view_options (parser),
+ lines (0), scale (1.0) {}
~view_cairo_t (void) {
if (debug)
cairo_debug_reset_static_data ();