Skip to content

Commit

Permalink
Subtitles: Complete CEA-708 font support.
Browse files Browse the repository at this point in the history
Clean up the CEA-708 font set and make sure all fonts are distributed
with MythTV.
  • Loading branch information
stichnot committed Jun 12, 2012
1 parent c062750 commit 5c047f4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
11 changes: 7 additions & 4 deletions mythtv/libs/libmythtv/subtitlescreen.cpp
Expand Up @@ -200,12 +200,12 @@ void SubtitleFormat::CreateProviderDefault(const QString &family,
static const char *cc708Fonts[] = {
"FreeMono", // default
"FreeMono", // mono serif
"DejaVu Serif", // prop serif
"Droid Serif", // prop serif
"Droid Sans Mono", // mono sans
"Liberation Sans", // prop sans
"Droid Sans", // prop sans
"Purisa", // casual
"URW Chancery L", // cursive
"Impact" // capitals
"TeX Gyre Chorus", // cursive
"Droid Serif" // small caps, QFont::SmallCaps will be applied
};
font->GetFace()->setFamily(cc708Fonts[attr.font_tag & 0x7]);
}
Expand Down Expand Up @@ -303,6 +303,9 @@ void SubtitleFormat::Load(const QString &family,
dynamic_cast<MythUIShape *>(negParent->GetChild(prefix));
if (!testBG)
testBG = negBG;
if (family == kSubFamily708 &&
(attr.font_tag & 0x7) == k708AttrFontSmallCaps)
resultFont->GetFace()->setCapitalization(QFont::SmallCaps);
m_fontMap[prefix] = resultFont;
m_shapeMap[prefix] = resultBG;
LOG(VB_VBI, LOG_DEBUG,
Expand Down
10 changes: 6 additions & 4 deletions mythtv/themes/default/osd_subtitle.xml
Expand Up @@ -71,27 +71,29 @@
</fontdef>

<!-- Font tag 2: "Proportional Serif" -->
<fontdef name="708_2" face="DejaVu Serif" from="provider">
<fontdef name="708_2" face="Droid Serif" from="provider">
</fontdef>

<!-- Font tag 3: "Monospaced Sans Serif" -->
<fontdef name="708_3" face="Droid Sans Mono" from="provider">
</fontdef>

<!-- Font tag 4: "Proportional Sans Serif" -->
<fontdef name="708_4" face="Liberation Sans" from="provider">
<fontdef name="708_4" face="Droid Sans" from="provider">
</fontdef>

<!-- Font tag 5: "Casual" -->
<fontdef name="708_5" face="Purisa" from="provider">
</fontdef>

<!-- Font tag 6: "Cursive" -->
<fontdef name="708_6" face="URW Chancery L" from="provider">
<fontdef name="708_6" face="TeX Gyre Chorus" from="provider">
</fontdef>

<!-- Font tag 7: "Small Capitals" -->
<fontdef name="708_7" face="Impact" from="provider">
<!-- Note: The Qt property QFont::SmallCaps is automatically
applied to this font. -->
<fontdef name="708_7" face="Droid Serif" from="provider">
</fontdef>

</window>
Expand Down
Binary file added mythtv/themes/fonts/Purisa.ttf
Binary file not shown.
Binary file not shown.

0 comments on commit 5c047f4

Please sign in to comment.