* text subs: use generic font family names
Allows the platform more flexibility in choosing the "best" font for the
platform.
* rendersub: make font configurable per platform
Use Lucida Console for mono font on windows since it chooses ugly,
difficult to read Courier New when using monospace family name.
(cherry picked from commit
65e24973e7deff59f93caabd1d561c8d0d2e9163)
int height = job->title->geometry.height - job->crop[0] - job->crop[1];
int width = job->title->geometry.width - job->crop[2] - job->crop[3];
int safe_height = 0.8 * job->title->geometry.height;
- hb_subtitle_add_ssa_header(w->subtitle, "Courier New",
+ hb_subtitle_add_ssa_header(w->subtitle, HB_FONT_MONO,
.08 * safe_height, width, height);
}
// When rendering subs, we need to push rollup subtitles out
// Generate generic SSA Script Info.
int height = job->title->geometry.height - job->crop[0] - job->crop[1];
int width = job->title->geometry.width - job->crop[2] - job->crop[3];
- hb_subtitle_add_ssa_header(w->subtitle, "Arial",
+ hb_subtitle_add_ssa_header(w->subtitle, HB_FONT_SANS,
.066 * job->title->geometry.height,
width, height);
}
// For now we just create a generic SSA Script Info.
int height = job->title->geometry.height - job->crop[0] - job->crop[1];
int width = job->title->geometry.width - job->crop[2] - job->crop[3];
- hb_subtitle_add_ssa_header(w->subtitle, "Arial",
+ hb_subtitle_add_ssa_header(w->subtitle, HB_FONT_SANS,
.066 * job->title->geometry.height,
width, height);
// Generate generic SSA Script Info.
int height = job->title->geometry.height - job->crop[0] - job->crop[1];
int width = job->title->geometry.width - job->crop[2] - job->crop[3];
- hb_subtitle_add_ssa_header(w->subtitle, "Arial",
+ hb_subtitle_add_ssa_header(w->subtitle, HB_FONT_SANS,
.066 * job->title->geometry.height,
width, height);
void hb_chapter_enqueue(hb_chapter_queue_t *q, hb_buffer_t *b);
void hb_chapter_dequeue(hb_chapter_queue_t *q, hb_buffer_t *b);
+/* Font names used for rendering subtitles */
+#if defined(SYS_MINGW)
+#define HB_FONT_MONO "Lucida Console"
+#define HB_FONT_SANS "sans-serif"
+#else
+#define HB_FONT_MONO "monospace"
+#define HB_FONT_SANS "sans-serif"
+#endif
+
int width = job->title->geometry.width - job->crop[2] - job->crop[3];
int safe_height = 0.8 * job->title->geometry.height;
// Use fixed widht font for CC
- hb_subtitle_add_ssa_header(filter->subtitle, "Courier New",
+ hb_subtitle_add_ssa_header(filter->subtitle, HB_FONT_MONO,
.08 * safe_height, width, height);
return ssa_post_init(filter, job);
}
// to have the header rewritten with the correct dimensions.
int height = job->title->geometry.height - job->crop[0] - job->crop[1];
int width = job->title->geometry.width - job->crop[2] - job->crop[3];
- hb_subtitle_add_ssa_header(filter->subtitle, "Arial",
+ hb_subtitle_add_ssa_header(filter->subtitle, HB_FONT_SANS,
.066 * job->title->geometry.height,
width, height);
return ssa_post_init(filter, job);