font.desc.treat_family_as_pattern = desc->treat_family_as_pattern;
font.desc.bold = desc->bold;
font.desc.italic = desc->italic;
+ font.desc.vertical = desc->vertical;
font.scale_x = font.scale_y = 1.;
font.v.x = font.v.y = 0;
void ass_font_set_transform(ASS_Font *font, double scale_x,
double scale_y, FT_Vector *v)
{
- font->scale_x = scale_x;
- font->scale_y = scale_y;
- if (v) {
- font->v.x = v->x;
- font->v.y = v->y;
+ if (font->desc.vertical) {
+ font->scale_x = scale_y;
+ font->scale_y = scale_x;
+ if (v) {
+ font->v.x = v->y;
+ font->v.y = v->x;
+ }
+ } else {
+ font->scale_x = scale_x;
+ font->scale_y = scale_y;
+ if (v) {
+ font->v.x = v->x;
+ font->v.y = v->y;
+ }
}
update_transform(font);
}
FT_Glyph glyph;
FT_Face face = 0;
int flags = 0;
+ int vertical = font->desc.vertical;
if (ch < 0x20)
return 0;
return 0;
}
+ if (vertical) {
+ FT_Matrix m = { 0, double_to_d16(-1.0), double_to_d16(1.0), 0 };
+ FT_Outline_Transform(&((FT_OutlineGlyph) glyph)->outline, &m);
+ FT_Outline_Translate(&((FT_OutlineGlyph) glyph)->outline,
+ face->glyph->metrics.vertAdvance * font->scale_y,
+ 0);
+ glyph->advance.x = face->glyph->linearVertAdvance * font->scale_y;
+ }
+
ass_strike_outline_glyph(face, font, glyph, deco & DECO_UNDERLINE,
deco & DECO_STRIKETHROUGH);
FT_Vector v = { 0, 0 };
int i;
+ if (font->desc.vertical)
+ return v;
+
for (i = 0; i < font->n_faces; ++i) {
FT_Face face = font->faces[i];
int i1 = FT_Get_Char_Index(face, c1);
{
unsigned val;
ASS_FontDesc desc;
- desc.family = strdup(render_priv->state.family);
- desc.treat_family_as_pattern =
- render_priv->state.treat_family_as_pattern;
+ desc.treat_family_as_pattern = render_priv->state.treat_family_as_pattern;
+
+ if (render_priv->state.family[0] == '@') {
+ desc.vertical = 1;
+ desc.family = strdup(render_priv->state.family + 1);
+ } else {
+ desc.vertical = 0;
+ desc.family = strdup(render_priv->state.family);
+ }
val = render_priv->state.bold;
// 0 = normal, 1 = bold, >1 = exact weight