COLORVAL(SecondaryColour)
COLORVAL(OutlineColour)
COLORVAL(BackColour)
- INTVAL(FontSize)
+ FPVAL(FontSize)
INTVAL(Bold)
INTVAL(Italic)
INTVAL(Underline)
// this will destroy SSA's TertiaryColour, but i'm not going to use it anyway
if (track->track_type == TRACK_TYPE_SSA)
target->OutlineColour = target->BackColour;
- INTVAL(FontSize)
+ FPVAL(FontSize)
INTVAL(Bold)
INTVAL(Italic)
INTVAL(Underline)
typedef struct bitmap_hash_key_s {
char bitmap; // bool : true = bitmap, false = outline
ass_font_t* font;
- int size; // font size
+ double size; // font size
uint32_t ch; // character code
unsigned outline; // border width, 16.16 fixed point value
int bold, italic;
// describes an outline glyph
typedef struct glyph_hash_key_s {
ass_font_t* font;
- int size; // font size
+ double size; // font size
uint32_t ch; // character code
int bold, italic;
unsigned scale_x, scale_y; // 16.16
{
int i;
FT_Matrix m;
- m.xx = double_to_d16(font->scale_x);
- m.yy = double_to_d16(font->scale_y);
+ double size_scale = font->size / (int)font->size;
+ m.xx = double_to_d16(font->scale_x * size_scale);
+ m.yy = double_to_d16(font->scale_y * size_scale);
m.xy = m.yx = 0;
for (i = 0; i < font->n_faces; ++i)
FT_Set_Transform(font->faces[i], &m, &font->v);
font.scale_x = font.scale_y = 1.;
font.v.x = font.v.y = 0;
- font.size = 0;
+ font.size = 0.;
#ifdef HAVE_FONTCONFIG
font.charset = FcCharSetCreate();
/**
* \brief Set font size
**/
-void ass_font_set_size(ass_font_t* font, int size)
+void ass_font_set_size(ass_font_t* font, double size)
{
int i;
if (font->size != size) {
font->size = size;
for (i = 0; i < font->n_faces; ++i)
- FT_Set_Pixel_Sizes(font->faces[i], 0, size);
+ FT_Set_Pixel_Sizes(font->faces[i], 0, (int)size);
+ update_transform(font);
}
}
font->faces[font->n_faces++] = face;
update_transform(font);
- FT_Set_Pixel_Sizes(face, 0, font->size);
+ FT_Set_Pixel_Sizes(face, 0, (int)font->size);
}
#endif
int n_faces;
double scale_x, scale_y; // current transform
FT_Vector v; // current shift
- int size;
+ double size;
#ifdef HAVE_FONTCONFIG
FcCharSet* charset;
#endif
ass_font_t* ass_font_new(ass_library_t* library, FT_Library ftlibrary, void* fc_priv, ass_font_desc_t* desc);
void ass_font_set_transform(ass_font_t* font, double scale_x, double scale_y, FT_Vector* v);
-void ass_font_set_size(ass_font_t* font, int size);
+void ass_font_set_size(ass_font_t* font, double size);
void ass_font_get_asc_desc(ass_font_t* font, uint32_t ch, int* asc, int* desc);
FT_Glyph ass_font_get_glyph(void* fontconfig_priv, ass_font_t* font, uint32_t ch, ass_hinting_t hinting);
FT_Vector ass_font_get_kerning(ass_font_t* font, uint32_t c1, uint32_t c2);
ass_font_t* font;
char* font_path;
- int font_size;
+ double font_size;
FT_Stroker stroker;
int alignment; // alignment overrides go here; if zero, style value will be used
double ass_internal_font_size_coeff = 0.8;
-static void change_font_size(int sz)
+static void change_font_size(double sz)
{
double size = sz * frame_context.font_scale;
else
render_context.hspacing = render_context.style->Spacing;
} else if (mystrcmp(&p, "fs")) {
- int val;
- if (mystrtoi(&p, 10, &val))
+ double val;
+ if (mystrtod(&p, &val))
val = render_context.font_size * ( 1 - pwr ) + val * pwr;
else
val = render_context.style->FontSize;
typedef struct ass_style_s {
char* Name;
char* FontName;
- int FontSize;
+ double FontSize;
uint32_t PrimaryColour;
uint32_t SecondaryColour;
uint32_t OutlineColour;