unsigned count = all_points.length - 4; for (unsigned i = 1; i < count; i++)
{ float x = all_points[i].x; float y = all_points[i].y;
xMin = hb_min (xMin, x);
xMax = hb_max (xMax, x);
yMin = hb_min (yMin, y);
yMax = hb_max (yMax, y);
}
}
// These are destined for storage in a 16 bit field to clamp the values to // fit into a 16 bit signed integer. int rounded_xMin = hb_clamp (roundf (xMin), -32768.0f, 32767.0f); int rounded_xMax = hb_clamp (roundf (xMax), -32768.0f, 32767.0f); int rounded_yMin = hb_clamp (roundf (yMin), -32768.0f, 32767.0f); int rounded_yMax = hb_clamp (roundf (yMax), -32768.0f, 32767.0f);
/* when pinned at default, no need to compile glyph header * and for empty glyphs: all_points only include phantom points.
* just update metrics and then return */ if (!glyph_header) returntrue;
// don't compute head/maxp values when glyph has no contours(type is EMPTY) // also ignore .notdef glyph when --notdef-outline is not enabled if (type == EMPTY ||
(gid == 0 && !(plan->flags & HB_SUBSET_FLAGS_NOTDEF_OUTLINE)))
{
head_maxp_info_p = nullptr;
composite_contours_p = nullptr;
}
// .notdef, set type to empty so we only update metrics and don't compile bytes for // it if (gid == 0 &&
!(plan->flags & HB_SUBSET_FLAGS_NOTDEF_OUTLINE))
{
type = EMPTY;
dest_start = hb_bytes_t ();
dest_end = hb_bytes_t ();
}
//dont compile bytes when pinned at default, just recalculate bounds if (!plan->pinned_at_default)
{ switch (type)
{ case COMPOSITE: if (!CompositeGlyph (*header, bytes).compile_bytes_with_deltas (dest_start,
points_with_deltas,
dest_end)) returnfalse; break; case SIMPLE: if (!SimpleGlyph (*header, bytes).compile_bytes_with_deltas (all_points,
plan->flags & HB_SUBSET_FLAGS_NO_HINTING,
dest_end)) returnfalse; break; case EMPTY: /* set empty bytes for empty glyph
* do not use source glyph's pointers */
dest_start = hb_bytes_t ();
dest_end = hb_bytes_t (); break;
}
}
#ifndef HB_NO_VAR if (coords)
glyf_accelerator.gvar->apply_deltas_to_points (gid,
coords,
points.as_array ().sub_array (old_length),
phantom_only && type == SIMPLE); #endif
// mainly used by CompositeGlyph calculating new X/Y offset value so no need to extend it // with child glyphs' points if (points_with_deltas != nullptr && depth == 0 && type == COMPOSITE)
{ if (unlikely (!points_with_deltas->resize (points.length))) returnfalse;
*points_with_deltas = points;
}
switch (type) { case SIMPLE: if (depth == 0 && head_maxp_info)
head_maxp_info->maxPoints = hb_max (head_maxp_info->maxPoints, all_points.length - old_length - 4); break; case COMPOSITE:
{ unsignedint comp_index = 0; for (auto &item : get_composite_iterator ())
{
hb_codepoint_t item_gid = item.get_gid ();
if (unlikely (current_glyphs->has (item_gid))) continue;
auto comp_points = all_points.as_array ().sub_array (old_count);
/* Copy phantom points from component if USE_MY_METRICS flag set */ if (use_my_metrics && item.is_use_my_metrics ()) for (unsignedint i = 0; i < PHANTOM_COUNT; i++)
phantoms[i] = comp_points[comp_points.length - PHANTOM_COUNT + i];
if (comp_points) // Empty in case of phantom_only
{ float matrix[4];
contour_point_t default_trans;
item.get_transformation (matrix, default_trans);
if (depth == 0 && shift_points_hori) /* Apply at top level */
{ /* Undocumented rasterizer behavior: * Shift points horizontally by the updated left side bearing
*/ float v = -phantoms[PHANTOM_LEFT].x; if (v) for (auto &point : all_points)
point.x += v;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.