21#include FT_INTERNAL_DEBUG_H
29#ifdef AF_CONFIG_OPTION_USE_WARPER
41#define FT_COMPONENT trace_aflatin
45#define FLAT_THRESHOLD( x ) ( x / 14 )
74 "latin standard widths computation (style `%s')\n"
75 "=====================================================\n"
77 af_style_names[
metrics->root.style_class->style] ));
98#ifdef FT_CONFIG_OPTION_PIC
109#ifdef FT_DEBUG_LEVEL_TRACE
126 unsigned int num_idx;
128#ifdef FT_DEBUG_LEVEL_TRACE
136#ifdef FT_DEBUG_LEVEL_TRACE
161 FT_TRACE5((
"standard character: U+%04lX (glyph index %d)\n",
165 if (
error ||
face->glyph->outline.n_points <= 0 )
214 for ( ; seg <
limit; seg++ )
229 axis->
widths[num_widths++].org = dist;
236 dummy->units_per_em / 100 );
255#ifdef FT_DEBUG_LEVEL_TRACE
300 for (
j =
i;
j > 0;
j-- )
359 FT_TRACE5((
"latin blue zones computation\n"
360 "============================\n"
374#ifdef FT_DEBUG_LEVEL_TRACE
381 if (
bs->properties )
435 FT_Int best_point, best_contour_first, best_contour_last;
441 unsigned int i, num_idx;
443#ifdef FT_DEBUG_LEVEL_TRACE
452#ifdef FT_DEBUG_LEVEL_TRACE
461 FT_TRACE5((
" U+%04lX unavailable\n", ch ));
472 for (
i = 0;
i < num_idx;
i++ )
484 if ( glyph_index == 0 )
486 FT_TRACE5((
" U+%04lX unavailable\n", ch ));
495#ifdef FT_DEBUG_LEVEL_TRACE
497 FT_TRACE5((
" U+%04lX contains no (usable) outlines\n", ch ));
499 FT_TRACE5((
" component %d of cluster starting with U+%04lX"
500 " contains no (usable) outlines\n",
i, ch ));
509 best_contour_first = 0;
510 best_contour_last = 0;
520 FT_Int old_best_point = best_point;
538 if ( best_point < 0 ||
points[pp].
y > best_y )
542 ascender =
FT_MAX( ascender, best_y + y_offset );
552 if ( best_point < 0 ||
points[pp].
y < best_y )
556 descender =
FT_MIN( descender, best_y + y_offset );
563 if ( best_point != old_best_point )
565 best_contour_first =
first;
566 best_contour_last =
last;
574 if ( best_point >= 0 )
578 FT_Int best_segment_first, best_segment_last;
579 FT_Int best_on_point_first, best_on_point_last;
583 best_segment_first = best_point;
584 best_segment_last = best_point;
588 best_on_point_first = best_point;
589 best_on_point_last = best_point;
593 best_on_point_first = -1;
594 best_on_point_last = -1;
605 if ( prev > best_contour_first )
608 prev = best_contour_last;
617 best_segment_first = prev;
621 best_on_point_first = prev;
622 if ( best_on_point_last < 0 )
623 best_on_point_last = prev;
626 }
while ( prev != best_point );
630 if (
next < best_contour_last )
633 next = best_contour_first;
640 best_segment_last =
next;
644 best_on_point_last =
next;
645 if ( best_on_point_first < 0 )
646 best_on_point_first =
next;
649 }
while (
next != best_point );
672 points[best_segment_first].
x );
674 if ( dist < length_threshold &&
675 best_segment_last - best_segment_first + 2 <=
676 best_contour_last - best_contour_first )
700 if ( prev > best_contour_first )
703 prev = best_contour_last;
705 if (
points[prev].
x != best_x )
708 }
while ( prev != best_point );
711 if ( prev == best_point )
716 first = best_segment_last;
747 if (
last < best_contour_last )
750 last = best_contour_first;
779 if ( l2r == left2right &&
780 d >= length_threshold )
786 if (
last < best_contour_last )
789 last = best_contour_first;
796 if (
last > best_contour_first )
799 last = best_contour_last;
813 }
while (
last != best_segment_first );
817 best_segment_first =
first;
818 best_segment_last =
last;
820 best_on_point_first = p_first;
821 best_on_point_last = p_last;
826 }
while (
last != best_segment_first );
836#ifdef FT_DEBUG_LEVEL_TRACE
838 FT_TRACE5((
" U+%04lX: best_y = %5ld", ch, best_y ));
840 FT_TRACE5((
" component %d of cluster starting with U+%04lX:"
841 " best_y = %5ld",
i, ch, best_y ));
852 if ( best_on_point_first >= 0 &&
853 best_on_point_last >= 0 &&
855 points[best_on_point_first].
x ) ) >
877 if ( best_y > best_y_extremum )
879 best_y_extremum = best_y;
885 if ( best_y < best_y_extremum )
887 best_y_extremum = best_y;
898 rounds[num_rounds++] = best_y_extremum;
900 flats[num_flats++] = best_y_extremum;
905 if ( num_flats == 0 && num_rounds == 0 )
923 blue_shoot = &
blue->shoot.org;
927 if ( num_flats == 0 )
930 *blue_shoot = rounds[num_rounds / 2];
932 else if ( num_rounds == 0 )
935 *blue_shoot = flats[num_flats / 2];
939 *blue_ref = flats [num_flats / 2];
940 *blue_shoot = rounds[num_rounds / 2];
946 if ( *blue_shoot != *blue_ref )
949 FT_Pos shoot = *blue_shoot;
957 *blue_shoot = ( shoot +
ref ) / 2;
959 FT_TRACE5((
" [overshoot smaller than reference,"
960 " taking mean value]\n" ));
964 blue->ascender = ascender;
965 blue->descender = descender;
984 " overshoot = %ld\n",
985 *blue_ref, *blue_shoot ));
1000 blue_sorted[
i] = &axis->
blues[
i];
1011#ifdef FT_DEBUG_LEVEL_TRACE
1019 a = &blue_sorted[
i]->
shoot.org;
1020#ifdef FT_DEBUG_LEVEL_TRACE
1025 a = &blue_sorted[
i]->
ref.org;
1029 b = &blue_sorted[
i + 1]->
shoot.org;
1031 b = &blue_sorted[
i + 1]->
ref.org;
1037 " adjusting %s %d to %ld\n",
1038 a_is_top ?
"overshoot" :
"reference",
1039 blue_sorted[
i] - axis->
blues,
1057 FT_Bool started = 0, same_width = 1;
1063 const char digits[] =
"0 1 2 3 4 5 6 7 8 9";
1073 unsigned int num_idx;
1106 metrics->root.digits_have_same_width = same_width;
1194 ppem =
metrics->root.scaler.face->size->metrics.x_ppem;
1205 fitted = ( scaled + threshold ) & ~63;
1207 if ( scaled != fitted )
1212 if ( fitted < scaled )
1227 max_height =
metrics->units_per_em;
1241 "af_latin_metrics_scale_dim:"
1242 " x height alignment (style `%s'):\n"
1244 " vertical scaling changed from %.5f to %.5f (by %d%%)\n"
1246 af_style_names[
metrics->root.style_class->style],
1248 new_scale / 65536.0,
1249 ( fitted - scaled ) * 100 / scaled ));
1253#ifdef FT_DEBUG_LEVEL_TRACE
1257 "af_latin_metrics_scale_dim:"
1258 " x height alignment (style `%s'):\n"
1260 " excessive vertical scaling abandoned\n"
1262 af_style_names[
metrics->root.style_class->style] ));
1271 axis->
delta = delta;
1276 metrics->root.scaler.x_delta = delta;
1281 metrics->root.scaler.y_delta = delta;
1286 af_style_names[
metrics->root.style_class->style] ));
1299 width->cur / 64.0 ));
1309#ifdef FT_DEBUG_LEVEL_TRACE
1311 FT_TRACE5((
"`%s' style is extra light (at current resolution)\n"
1313 af_style_names[
metrics->root.style_class->style] ));
1318#ifdef FT_DEBUG_LEVEL_TRACE
1320 FT_TRACE5((
"blue zones (style `%s')\n",
1321 af_style_names[
metrics->root.style_class->style] ));
1335 blue->flags &= ~AF_LATIN_BLUE_ACTIVE;
1339 if ( dist <= 48 && dist >= -48 )
1352 delta1 =
blue->shoot.org -
blue->ref.org;
1361 else if ( delta2 < 64 )
1362 delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );
1370 blue->shoot.fit =
blue->ref.fit + delta2;
1381 else if ( delta2 < 48 )
1390 blue->shoot.fit =
blue->ref.fit - delta2;
1423 if (
b->ref.fit <=
blue->shoot.fit &&
1424 b->shoot.fit >=
blue->ref.fit )
1432#ifdef FT_DEBUG_LEVEL_TRACE
1438 FT_TRACE5((
" reference %d: %d scaled to %.2f%s\n"
1439 " overshoot %d: %d scaled to %.2f%s\n",
1442 blue->ref.fit / 64.0,
1447 blue->shoot.fit / 64.0,
1462 metrics->root.scaler.render_mode = scaler->render_mode;
1463 metrics->root.scaler.face = scaler->face;
1464 metrics->root.scaler.flags = scaler->flags;
1520 segment_dir = major_dir;
1522 axis->num_segments = 0;
1551 for ( ; contour < contour_limit; contour++ )
1562 FT_Pos min_coord = 32000;
1563 FT_Pos max_coord = -32000;
1566 FT_Pos min_on_coord = 32000;
1567 FT_Pos max_on_coord = -32000;
1573 FT_Pos prev_min_pos = min_pos;
1574 FT_Pos prev_max_pos = max_pos;
1575 FT_Pos prev_min_coord = min_coord;
1576 FT_Pos prev_max_coord = max_coord;
1579 FT_Pos prev_min_on_coord = min_on_coord;
1580 FT_Pos prev_max_on_coord = max_on_coord;
1621 if (
v < min_coord )
1624 min_flags =
point->flags;
1626 if (
v > max_coord )
1629 max_flags =
point->flags;
1636 if (
v < min_on_coord )
1638 if (
v > max_on_coord )
1648 if ( !prev_segment || segment->
first != prev_segment->
last )
1653 segment->last =
point;
1654 segment->pos = (
FT_Short)( ( min_pos + max_pos ) >> 1 );
1655 segment->delta = (
FT_Short)( ( max_pos - min_pos ) >> 1 );
1661 ( max_on_coord - min_on_coord ) < flat_threshold )
1664 segment->min_coord = (
FT_Short)min_coord;
1665 segment->max_coord = (
FT_Short)max_coord;
1666 segment->height = segment->max_coord - segment->min_coord;
1668 prev_segment = segment;
1669 prev_min_pos = min_pos;
1670 prev_max_pos = max_pos;
1671 prev_min_coord = min_coord;
1672 prev_max_coord = max_coord;
1673 prev_min_flags = min_flags;
1674 prev_max_flags = max_flags;
1675 prev_min_on_coord = min_on_coord;
1676 prev_max_on_coord = max_on_coord;
1693 if ( prev_min_pos < min_pos )
1694 min_pos = prev_min_pos;
1695 if ( prev_max_pos > max_pos )
1696 max_pos = prev_max_pos;
1698 if ( prev_min_coord < min_coord )
1700 min_coord = prev_min_coord;
1701 min_flags = prev_min_flags;
1703 if ( prev_max_coord > max_coord )
1705 max_coord = prev_max_coord;
1706 max_flags = prev_max_flags;
1709 if ( prev_min_on_coord < min_on_coord )
1710 min_on_coord = prev_min_on_coord;
1711 if ( prev_max_on_coord > max_on_coord )
1712 max_on_coord = prev_max_on_coord;
1721 ( max_on_coord - min_on_coord ) < flat_threshold )
1724 prev_segment->
flags &= ~AF_EDGE_ROUND;
1736 if (
FT_ABS( prev_max_coord - prev_min_coord ) >
1737 FT_ABS( max_coord - min_coord ) )
1741 if ( min_pos < prev_min_pos )
1742 prev_min_pos = min_pos;
1743 if ( max_pos > prev_max_pos )
1744 prev_max_pos = max_pos;
1748 prev_max_pos ) >> 1 );
1750 prev_min_pos ) >> 1 );
1756 if ( prev_min_pos < min_pos )
1757 min_pos = prev_min_pos;
1758 if ( prev_max_pos > max_pos )
1759 max_pos = prev_max_pos;
1761 segment->last =
point;
1762 segment->pos = (
FT_Short)( ( min_pos + max_pos ) >> 1 );
1763 segment->delta = (
FT_Short)( ( max_pos - min_pos ) >> 1 );
1766 ( max_on_coord - min_on_coord ) < flat_threshold )
1769 segment->min_coord = (
FT_Short)min_coord;
1770 segment->max_coord = (
FT_Short)max_coord;
1771 segment->height = segment->max_coord -
1774 *prev_segment = *segment;
1776 prev_min_pos = min_pos;
1777 prev_max_pos = max_pos;
1778 prev_min_coord = min_coord;
1779 prev_max_coord = max_coord;
1780 prev_min_flags = min_flags;
1781 prev_max_flags = max_flags;
1782 prev_min_on_coord = min_on_coord;
1783 prev_max_on_coord = max_on_coord;
1787 axis->num_segments--;
1822 segment->dir = (
FT_Char)segment_dir;
1823 segment->first =
point;
1824 segment->last =
point;
1829 prev_segment = segment - 1;
1831 min_pos = max_pos =
point->u;
1832 min_coord = max_coord =
point->v;
1833 min_flags = max_flags =
point->flags;
1837 min_on_coord = 32000;
1838 max_on_coord = -32000;
1841 min_on_coord = max_on_coord =
point->v;
1857 segment->height = 0;
1874 AF_Segment segments_end = segments + axis->num_segments;
1877 for ( segment = segments; segment < segments_end; segment++ )
1885 if ( first_v < last_v )
1891 if (
p->v < first_v )
1892 segment->height = (
FT_Short)( segment->height +
1893 ( ( first_v -
p->v ) >> 1 ) );
1896 if (
p->v > last_v )
1897 segment->height = (
FT_Short)( segment->height +
1898 ( (
p->v - last_v ) >> 1 ) );
1906 if (
p->v > first_v )
1907 segment->height = (
FT_Short)( segment->height +
1908 ( (
p->v - first_v ) >> 1 ) );
1911 if (
p->v < last_v )
1912 segment->height = (
FT_Short)( segment->height +
1913 ( ( last_v -
p->v ) >> 1 ) );
1935 FT_Pos len_threshold, len_score, dist_score, max_width;
1940 max_width = widths[width_count - 1].org;
1946 if ( len_threshold == 0 )
1958 for ( seg1 = segments; seg1 < segment_limit; seg1++ )
1965 for ( seg2 = segments; seg2 < segment_limit; seg2++ )
1971 if ( seg1->
dir + seg2->
dir == 0 && pos2 > pos1 )
1979 if ( min < seg2->min_coord )
1988 if (
len >= len_threshold )
2004 FT_Pos dist = pos2 - pos1;
2006 FT_Pos dist_demerit, score;
2013 FT_Pos delta = ( dist << 10 ) / max_width - ( 1 << 10 );
2016 if ( delta > 10000 )
2017 dist_demerit = 32000;
2018 else if ( delta > 0 )
2019 dist_demerit = delta * delta / dist_score;
2024 dist_demerit = dist;
2026 score = dist_demerit + len_score /
len;
2029 if ( score < seg1->score )
2031 seg1->
score = score;
2035 if ( score < seg2->score )
2037 seg2->
score = score;
2046 for ( seg1 = segments; seg1 < segment_limit; seg1++ )
2052 if ( seg2->
link != seg1 )
2073#ifdef FT_CONFIG_OPTION_PIC
2081 FT_Bool top_to_bottom_hinting = 0;
2091 FT_Pos edge_distance_threshold;
2092 FT_Pos segment_length_threshold;
2093 FT_Pos segment_width_threshold;
2117 segment_length_threshold = 0;
2144 if ( edge_distance_threshold > 64 / 4 )
2145 edge_distance_threshold = 64 / 4;
2147 edge_distance_threshold =
FT_DivFix( edge_distance_threshold,
2150 for ( seg = segments; seg < segment_limit; seg++ )
2158 if ( seg->
height < segment_length_threshold ||
2159 seg->
delta > segment_width_threshold ||
2166 2 * seg->
height < 3 * segment_length_threshold )
2170 for ( ee = 0; ee < axis->
num_edges; ee++ )
2180 if ( dist < edge_distance_threshold && edge->
dir == seg->
dir )
2196 top_to_bottom_hinting,
2224 for ( seg = segments; seg < segment_limit; seg++ )
2234 for ( ee = 0; ee < axis->
num_edges; ee++ )
2244 if ( dist < edge_distance_threshold )
2287 for ( edge = edges; edge < edge_limit; edge++ )
2296 }
while ( seg != edge->
first );
2300 for ( edge = edges; edge < edge_limit; edge++ )
2325 if ( seg->
dir == up_dir )
2349 edge2 = edge->
serif;
2358 edge_delta = edge->
fpos - edge2->
fpos;
2359 if ( edge_delta < 0 )
2360 edge_delta = -edge_delta;
2362 seg_delta = seg->
pos - seg2->
pos;
2363 if ( seg_delta < 0 )
2364 seg_delta = -seg_delta;
2366 if ( seg_delta < edge_delta )
2374 edge->
serif = edge2;
2383 }
while ( seg != edge->
first );
2388 if ( is_round > 0 && is_round >= is_straight )
2398 else if ( ups < downs )
2401 else if ( ups == downs )
2459 for ( ; edge < edge_limit; edge++ )
2463 FT_Bool best_blue_is_neutral = 0;
2472 if ( best_dist > 64 / 2 )
2478 FT_Bool is_top_blue, is_neutral_blue, is_major_dir;
2498 if ( is_top_blue ^ is_major_dir || is_neutral_blue )
2509 if ( dist < best_dist )
2512 best_blue = &
blue->ref;
2513 best_blue_is_neutral = is_neutral_blue;
2528 if ( is_top_blue ^ is_under_ref )
2530 dist = edge->
fpos -
blue->shoot.org;
2535 if ( dist < best_dist )
2538 best_blue = &
blue->shoot;
2539 best_blue_is_neutral = is_neutral_blue;
2549 if ( best_blue_is_neutral )
2563 FT_UInt32 scaler_flags, other_flags;
2586 scaler_flags =
hints->scaler_flags;
2623#ifdef AF_CONFIG_OPTION_USE_WARPER
2625 if ( !
metrics->root.globals->module->warping )
2629 hints->scaler_flags = scaler_flags;
2630 hints->other_flags = other_flags;
2653 FT_Pos best = 64 + 32 + 2;
2679 if (
width < scaled + 48 )
2684 if (
width > scaled - 48 )
2737 else if ( dist < 56 )
2740 if ( axis->width_count > 0 )
2746 delta = dist - axis->widths[0].cur;
2753 dist = axis->widths[0].cur;
2760 if ( dist < 3 * 64 )
2768 else if ( delta < 32 )
2771 else if ( delta < 54 )
2794 if ( ( (
width > 0 ) && ( base_delta > 0 ) ) ||
2795 ( (
width < 0 ) && ( base_delta < 0 ) ) )
2801 bdelta = base_delta;
2802 else if ( ppem < 30 )
2803 bdelta = ( base_delta * (
FT_Pos)( 30 - ppem ) ) / 20;
2809 dist = ( dist - bdelta + 32 ) & ~63;
2828 dist = ( dist + 16 ) & ~63;
2842 dist = ( dist + 32 ) & ~63;
2851 dist = ( dist + 64 ) >> 1;
2853 else if ( dist < 128 )
2864 dist = ( dist + 22 ) & ~63;
2865 delta = dist - org_dist;
2873 dist = ( dist + 64 ) >> 1;
2878 dist = ( dist + 32 ) & ~63;
2903 dist = stem_edge->
opos - base_edge->
opos;
2904 base_delta = base_edge->
pos - base_edge->
opos;
2912 stem_edge->
pos = base_edge->
pos + fitted_width;
2914 FT_TRACE5((
" LINK: edge %d (opos=%.2f) linked to %.2f,"
2915 " dist was %.2f, now %.2f\n",
2916 stem_edge -
hints->axis[dim].edges, stem_edge->
opos / 64.0,
2917 stem_edge->
pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
2960#ifdef FT_CONFIG_OPTION_PIC
2968 FT_Bool top_to_bottom_hinting = 0;
2970#ifdef FT_DEBUG_LEVEL_TRACE
2975 FT_TRACE5((
"latin %s edge hinting (style `%s')\n",
2977 af_style_names[
hints->metrics->style_class->style] ));
2987 for ( edge = edges; edge < edge_limit; edge++ )
3017 edge2->
flags &= ~AF_EDGE_NEUTRAL;
3022 edge->
flags &= ~AF_EDGE_NEUTRAL;
3041#ifdef FT_DEBUG_LEVEL_TRACE
3043 FT_TRACE5((
" BLUE_ANCHOR: edge %d (opos=%.2f) snapped to %.2f,"
3044 " was %.2f (anchor=edge %d)\n",
3045 edge1 - edges, edge1->
opos / 64.0,
blue->fit / 64.0,
3046 edge1->
pos / 64.0, edge - edges ));
3048 FT_TRACE5((
" BLUE: edge %d (opos=%.2f) snapped to %.2f,"
3050 edge1 - edges, edge1->
opos / 64.0,
blue->fit / 64.0,
3051 edge1->
pos / 64.0 ));
3064#ifdef FT_DEBUG_LEVEL_TRACE
3076 for ( edge = edges; edge < edge_limit; edge++ )
3097 FT_TRACE5((
" ASSERTION FAILED for edge %d\n", edge2 - edges ));
3102#ifdef FT_DEBUG_LEVEL_TRACE
3112 FT_Pos org_len, org_center, cur_len;
3116 org_len = edge2->
opos - edge->
opos;
3125 if ( cur_len <= 64 )
3140 org_center = edge->
opos + ( org_len >> 1 );
3143 error1 = org_center - ( cur_pos1 - u_off );
3147 error2 = org_center - ( cur_pos1 + d_off );
3156 edge->
pos = cur_pos1 - cur_len / 2;
3157 edge2->
pos = edge->
pos + cur_len;
3165 FT_TRACE5((
" ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)"
3166 " snapped to %.2f and %.2f\n",
3167 edge - edges, edge->
opos / 64.0,
3168 edge2 - edges, edge2->
opos / 64.0,
3169 edge->
pos / 64.0, edge2->
pos / 64.0 ));
3173#ifdef FT_DEBUG_LEVEL_TRACE
3179 FT_Pos org_pos, org_len, org_center, cur_len;
3180 FT_Pos cur_pos1, cur_pos2, delta1, delta2;
3183 org_pos = anchor->
pos + ( edge->
opos - anchor->
opos );
3184 org_len = edge2->
opos - edge->
opos;
3185 org_center = org_pos + ( org_len >> 1 );
3194 FT_TRACE5((
" ADJUST: edge %d (pos=%.2f) moved to %.2f\n",
3195 edge - edges, edge->
pos / 64.0,
3196 ( edge2->
pos - cur_len ) / 64.0 ));
3198 edge->
pos = edge2->
pos - cur_len;
3201 else if ( cur_len < 96 )
3208 if ( cur_len <= 64 )
3219 delta1 = org_center - ( cur_pos1 - u_off );
3223 delta2 = org_center - ( cur_pos1 + d_off );
3227 if ( delta1 < delta2 )
3232 edge->
pos = cur_pos1 - cur_len / 2;
3233 edge2->
pos = cur_pos1 + cur_len / 2;
3235 FT_TRACE5((
" STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)"
3236 " snapped to %.2f and %.2f\n",
3237 edge - edges, edge->
opos / 64.0,
3238 edge2 - edges, edge2->
opos / 64.0,
3239 edge->
pos / 64.0, edge2->
pos / 64.0 ));
3244 org_pos = anchor->
pos + ( edge->
opos - anchor->
opos );
3245 org_len = edge2->
opos - edge->
opos;
3246 org_center = org_pos + ( org_len >> 1 );
3254 delta1 = cur_pos1 + ( cur_len >> 1 ) - org_center;
3258 cur_pos2 =
FT_PIX_ROUND( org_pos + org_len ) - cur_len;
3259 delta2 = cur_pos2 + ( cur_len >> 1 ) - org_center;
3263 edge->
pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
3264 edge2->
pos = edge->
pos + cur_len;
3266 FT_TRACE5((
" STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)"
3267 " snapped to %.2f and %.2f\n",
3268 edge - edges, edge->
opos / 64.0,
3269 edge2 - edges, edge2->
opos / 64.0,
3270 edge->
pos / 64.0, edge2->
pos / 64.0 ));
3273#ifdef FT_DEBUG_LEVEL_TRACE
3280 if ( edge > edges &&
3281 ( top_to_bottom_hinting ? ( edge->
pos > edge[-1].
pos )
3282 : ( edge->
pos < edge[-1].
pos ) ) )
3288#ifdef FT_DEBUG_LEVEL_TRACE
3289 FT_TRACE5((
" BOUND: edge %d (pos=%.2f) moved to %.2f\n",
3292 edge[-1].
pos / 64.0 ));
3297 edge->
pos = edge[-1].
pos;
3318 n_edges = edge_limit - edges;
3341 span = dist1 - dist2;
3347 delta = edge3->
pos - ( 2 * edge2->
pos - edge1->
pos );
3348 edge3->
pos -= delta;
3353 if ( n_edges == 12 )
3355 ( edges + 8 )->
pos -= delta;
3356 ( edges + 11 )->
pos -= delta;
3365 if ( has_serifs || !anchor )
3371 for ( edge = edges; edge < edge_limit; edge++ )
3388 if ( delta < 64 + 16 )
3391 FT_TRACE5((
" SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)"
3392 " aligned to %.2f\n",
3393 edge - edges, edge->
opos / 64.0,
3395 edge->
pos / 64.0 ));
3401 FT_TRACE5((
" SERIF_ANCHOR: edge %d (opos=%.2f)"
3402 " snapped to %.2f\n",
3403 edge-edges, edge->
opos / 64.0, edge->
pos / 64.0 ));
3419 after < edge_limit && after > edge )
3424 edge->pos =
before->pos +
3429 FT_TRACE5((
" SERIF_LINK1: edge %d (opos=%.2f) snapped to %.2f"
3430 " from %d (opos=%.2f)\n",
3431 edge - edges, edge->
opos / 64.0,
3437 edge->pos = anchor->
pos +
3438 ( ( edge->opos - anchor->
opos + 16 ) & ~31 );
3439 FT_TRACE5((
" SERIF_LINK2: edge %d (opos=%.2f)"
3440 " snapped to %.2f\n",
3441 edge - edges, edge->
opos / 64.0, edge->pos / 64.0 ));
3445#ifdef FT_DEBUG_LEVEL_TRACE
3450 if ( edge > edges &&
3451 ( top_to_bottom_hinting ? ( edge->
pos > edge[-1].
pos )
3452 : ( edge->
pos < edge[-1].
pos ) ) )
3458#ifdef FT_DEBUG_LEVEL_TRACE
3459 FT_TRACE5((
" BOUND: edge %d (pos=%.2f) moved to %.2f\n",
3462 edge[-1].
pos / 64.0 ));
3466 edge->
pos = edge[-1].
pos;
3470 if ( edge + 1 < edge_limit &&
3472 ( top_to_bottom_hinting ? ( edge->
pos < edge[1].
pos )
3473 : ( edge->
pos > edge[1].
pos ) ) )
3479#ifdef FT_DEBUG_LEVEL_TRACE
3480 FT_TRACE5((
" BOUND: edge %d (pos=%.2f) moved to %.2f\n",
3483 edge[1].
pos / 64.0 ));
3494#ifdef FT_DEBUG_LEVEL_TRACE
3550#ifdef AF_CONFIG_OPTION_USE_WARPER
3595 af_latin_writing_system_class,
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
af_sort_pos(FT_UInt count, FT_Pos *table)
af_sort_and_quantize_widths(FT_UInt *count, AF_Width table, FT_Pos threshold)
#define AF_BLUE_STRING_MAX_LEN
#define GET_UTF8_CHAR(ch, p)
#define AF_BLUE_STRINGSET_MAX_LEN
enum AF_Blue_Stringset_ AF_Blue_Stringset
#define AF_PROP_INCREASE_X_HEIGHT_MIN
af_axis_hints_new_edge(AF_AxisHints axis, FT_Int fpos, AF_Direction dir, FT_Bool top_to_bottom_hinting, FT_Memory memory, AF_Edge *anedge)
af_glyph_hints_done(AF_GlyphHints hints)
af_glyph_hints_align_edge_points(AF_GlyphHints hints, AF_Dimension dim)
af_glyph_hints_save(AF_GlyphHints hints, FT_Outline *outline)
af_glyph_hints_rescale(AF_GlyphHints hints, AF_StyleMetrics metrics)
af_axis_hints_new_segment(AF_AxisHints axis, FT_Memory memory, AF_Segment *asegment)
af_glyph_hints_reload(AF_GlyphHints hints, FT_Outline *outline)
af_glyph_hints_align_strong_points(AF_GlyphHints hints, AF_Dimension dim)
af_glyph_hints_align_weak_points(AF_GlyphHints hints, AF_Dimension dim)
af_glyph_hints_init(AF_GlyphHints hints, FT_Memory memory)
#define AF_HINTS_DO_BLUES(h)
#define AF_HINTS_DO_WARP(h)
#define AF_HINTS_DO_HORIZONTAL(h)
FT_BEGIN_HEADER enum AF_Dimension_ AF_Dimension
enum AF_Direction_ AF_Direction
#define AF_HINTS_DO_VERTICAL(h)
static void af_latin_align_serif_edge(AF_GlyphHints hints, AF_Edge base, AF_Edge serif)
af_latin_get_standard_widths(AF_LatinMetrics metrics, FT_Pos *stdHW, FT_Pos *stdVW)
af_latin_metrics_init(AF_LatinMetrics metrics, FT_Face face)
static void af_latin_align_linked_edge(AF_GlyphHints hints, AF_Dimension dim, AF_Edge base_edge, AF_Edge stem_edge)
#define FLAT_THRESHOLD(x)
static void af_latin_metrics_scale_dim(AF_LatinMetrics metrics, AF_Scaler scaler, AF_Dimension dim)
static void af_latin_sort_blue(FT_UInt count, AF_LatinBlue *table)
static FT_Pos af_latin_compute_stem_width(AF_GlyphHints hints, AF_Dimension dim, FT_Pos width, FT_Pos base_delta, FT_UInt base_flags, FT_UInt stem_flags)
static FT_Error af_latin_hints_apply(FT_UInt glyph_index, AF_GlyphHints hints, FT_Outline *outline, AF_LatinMetrics metrics)
static void af_latin_hints_compute_blue_edges(AF_GlyphHints hints, AF_LatinMetrics metrics)
af_latin_metrics_scale(AF_LatinMetrics metrics, AF_Scaler scaler)
static FT_Error af_latin_hints_init(AF_GlyphHints hints, AF_LatinMetrics metrics)
static void af_latin_hint_edges(AF_GlyphHints hints, AF_Dimension dim)
static FT_Pos af_latin_snap_width(AF_Width widths, FT_UInt count, FT_Pos width)
af_latin_hints_link_segments(AF_GlyphHints hints, FT_UInt width_count, AF_WidthRec *widths, AF_Dimension dim)
af_latin_hints_compute_segments(AF_GlyphHints hints, AF_Dimension dim)
af_latin_metrics_init_widths(AF_LatinMetrics metrics, FT_Face face)
af_latin_metrics_check_digits(AF_LatinMetrics metrics, FT_Face face)
af_latin_hints_compute_edges(AF_GlyphHints hints, AF_Dimension dim)
static void af_latin_metrics_init_blues(AF_LatinMetrics metrics, FT_Face face)
af_latin_hints_detect_features(AF_GlyphHints hints, FT_UInt width_count, AF_WidthRec *widths, AF_Dimension dim)
#define AF_LATIN_IS_X_HEIGHT_BLUE(b)
#define AF_LATIN_IS_TOP_BLUE(b)
#define AF_LATIN_HINTS_STEM_ADJUST
#define AF_LATIN_BLUE_SUB_TOP
#define AF_LATIN_HINTS_DO_MONO(h)
#define AF_LATIN_MAX_WIDTHS
#define AF_LATIN_HINTS_VERT_SNAP
#define AF_LATIN_HINTS_MONO
#define AF_LATIN_HINTS_DO_VERT_SNAP(h)
#define AF_LATIN_IS_LONG_BLUE(b)
#define AF_LATIN_IS_NEUTRAL_BLUE(b)
#define AF_LATIN_IS_SUB_TOP_BLUE(b)
#define AF_LATIN_CONSTANT(metrics, c)
struct AF_LatinMetricsRec_ * AF_LatinMetrics
#define AF_LATIN_BLUE_TOP
#define AF_LATIN_HINTS_DO_HORZ_SNAP(h)
#define AF_LATIN_HINTS_DO_STEM_ADJUST(h)
#define AF_LATIN_BLUE_ACTIVE
#define AF_LATIN_BLUE_ADJUSTMENT
#define AF_LATIN_HINTS_HORZ_SNAP
#define AF_LATIN_BLUE_NEUTRAL
#define AF_SCRIPT_CLASSES_GET
void * af_shaper_buf_create(FT_Face face)
const char * af_shaper_get_cluster(const char *p, AF_StyleMetrics metrics, void *buf_, unsigned int *count)
FT_ULong af_shaper_get_elem(AF_StyleMetrics metrics, void *buf_, unsigned int idx, FT_Long *advance, FT_Long *y_offset)
void af_shaper_buf_destroy(FT_Face face, void *buf)
Arabic default AF_WRITING_SYSTEM_LATIN
#define AF_SCALER_FLAG_NO_WARPER
FT_Error(* AF_WritingSystem_InitMetricsFunc)(AF_StyleMetrics metrics, FT_Face face)
void(* AF_WritingSystem_ScaleMetricsFunc)(AF_StyleMetrics metrics, AF_Scaler scaler)
FT_BEGIN_HEADER struct AF_WidthRec_ AF_WidthRec
FT_BEGIN_HEADER struct AF_WidthRec_ * AF_Width
void(* AF_WritingSystem_DoneMetricsFunc)(AF_StyleMetrics metrics)
FT_Error(* AF_WritingSystem_InitHintsFunc)(AF_GlyphHints hints, AF_StyleMetrics metrics)
#define AF_DEFINE_WRITING_SYSTEM_CLASS( writing_system_class, system, m_size, m_init, m_scale, m_done, m_stdw, h_init, h_apply)
FT_Error(* AF_WritingSystem_ApplyHintsFunc)(FT_UInt glyph_index, AF_GlyphHints hints, FT_Outline *outline, AF_StyleMetrics metrics)
#define AF_SCALER_FLAG_NO_HORIZONTAL
void(* AF_WritingSystem_GetStdWidthsFunc)(AF_StyleMetrics metrics, FT_Pos *stdHW, FT_Pos *stdVW)
af_warper_compute(AF_Warper warper, AF_GlyphHints hints, AF_Dimension dim, FT_Fixed *a_scale, FT_Fixed *a_delta)
FT_Load_Glyph(FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags)
#define FT_STYLE_FLAG_ITALIC
enum FT_Render_Mode_ FT_Render_Mode
FT_DivFix(FT_Long a, FT_Long b)
FT_Select_Charmap(FT_Face face, FT_Encoding encoding)
FT_Set_Charmap(FT_Face face, FT_CharMap charmap)
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
FT_MulFix(FT_Long a, FT_Long b)
#define FT_TRACE5(varformat)
#define FT_CURVE_TAG(flag)
FT_BEGIN_HEADER typedef signed long FT_Pos
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLint GLsizei width
GLenum GLenum GLenum GLenum GLenum scale
GLenum GLenum GLvoid GLvoid GLvoid * span
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLubyte GLubyte GLubyte GLubyte w
GLsizei const GLfloat * points
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static const int digits[]
static struct msdos_boot_sector bs
static char memory[1024 *256]
static unsigned __int64 next
namespace GUID const ADDRINFOEXW * hints
AF_LatinBlueRec blues[AF_BLUE_STRINGSET_MAX]
AF_WidthRec widths[AF_LATIN_MAX_WIDTHS]
FT_Pos edge_distance_threshold
FT_Render_Mode render_mode
const char * standard_charstring
FT_Bool top_to_bottom_hinting
AF_Blue_Stringset blue_stringset
__inline int before(__u32 seq1, __u32 seq2)
__inline int after(__u32 seq1, __u32 seq2)