[justify] Rename hb-view --width to hb-view --justify-to
diff --git a/util/shape-options.hh b/util/shape-options.hh
index 6096b36..b22b958 100644
--- a/util/shape-options.hh
+++ b/util/shape-options.hh
@@ -161,7 +161,7 @@
}
else
{
- if (width <= 0)
+ if (advance <= 0)
{
if (!hb_shape_full (font, buffer, features, num_features, shapers))
{
@@ -170,11 +170,11 @@
goto fail;
}
- if (width < 0)
+ if (advance < 0)
{
float unit = (1 << SUBPIXEL_BITS);
- /* Calculate buffer width */
+ /* Calculate buffer advance */
float w = 0;
unsigned count = 0;
hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (buffer, &count);
@@ -185,7 +185,7 @@
for (unsigned i = 0; i < count; i++)
w += pos[i].y_advance;
- printf ("Default width: %u\n", (unsigned) roundf (w / unit));
+ printf ("Default size: %u\n", (unsigned) roundf (w / unit));
exit (0);
}
}
@@ -193,12 +193,12 @@
else
{
float unit = (1 << SUBPIXEL_BITS);
- float target_width = width * unit;
+ float target_advance = advance * unit;
float w = 0;
hb_tag_t var_tag;
float var_value;
if (!hb_shape_justify (font, buffer, features, num_features, shapers,
- target_width - unit * 0.5f, target_width + unit * 0.5f,
+ target_advance - unit * 0.5f, target_advance + unit * 0.5f,
&w, &var_tag, &var_value))
{
if (error)
@@ -242,7 +242,7 @@
hb_feature_t *features = nullptr;
unsigned int num_features = 0;
char **shapers = nullptr;
- signed width = 0;
+ signed advance = 0;
hb_bool_t utf8_clusters = false;
hb_codepoint_t invisible_glyph = 0;
hb_codepoint_t not_found_glyph = 0;
@@ -370,8 +370,8 @@
{"bot", 0, 0, G_OPTION_ARG_NONE, &this->bot, "Treat text as beginning-of-paragraph", nullptr},
{"eot", 0, 0, G_OPTION_ARG_NONE, &this->eot, "Treat text as end-of-paragraph", nullptr},
#ifdef HB_EXPERIMENTAL_API
- {"width", 'w',0,
- G_OPTION_ARG_INT, &this->width, "Target width to justify to", "WIDTH, or -1"},
+ {"justify-to", 0, 0,
+ G_OPTION_ARG_INT, &this->advance, "Target size to justify to", "SIZE, or -1"},
#endif
{"preserve-default-ignorables",0, 0, G_OPTION_ARG_NONE, &this->preserve_default_ignorables, "Preserve Default-Ignorable characters", nullptr},
{"remove-default-ignorables",0, 0, G_OPTION_ARG_NONE, &this->remove_default_ignorables, "Remove Default-Ignorable characters", nullptr},