1
0
forked from 0ad/0ad

Detect and fix characters missing from fonts

This was SVN commit r10840.
This commit is contained in:
Ykkrosh 2011-12-31 16:34:42 +00:00
parent 4d41b064a8
commit e1f7d7e599
12 changed files with 68 additions and 16 deletions

View File

@ -8,7 +8,7 @@
</Health>
<Identity>
<Civ>hele</Civ>
<SpecificName>Limn</SpecificName>
<SpecificName>Limḗn</SpecificName>
<History>Greece is a sea country, which is why some of the greatest Hellenic and Hellenistic cities like Ephesus, Corinth, Alexandria and Antioch were built by the sea. It should also be noted that all colonies during the Great Colonisation were thriving port centres, which traded with the local population.</History>
</Identity>
<TrainingQueue>

View File

@ -8,7 +8,7 @@
</Health>
<Identity>
<Civ>hele</Civ>
<SpecificName>Apoth</SpecificName>
<SpecificName>Apothḗ</SpecificName>
<History>Resources and building materials were kept in warehouses.</History>
</Identity>
<VisualActor>

View File

@ -12,7 +12,7 @@
</Health>
<Identity>
<Civ>hele</Civ>
<SpecificName>Nes</SpecificName>
<SpecificName>Neṓs</SpecificName>
<History>The Hellenes built marvelous temples in order to honour their polytheistic pantheon. While all gods were venerated, a specific patron deity was supposed to watch over each polis.</History>
</Identity>
<Obstruction>

View File

@ -8,8 +8,8 @@
</Auras>
<Identity>
<Civ>hele</Civ>
<GenericName>Demetrius The Besieger</GenericName>
<SpecificName>Dēmḗtrios Poliorkḗtēs</SpecificName>
<GenericName>Demetrius The Besieger</GenericName>
<SpecificName>Dēmḗtrios Poliorkḗtēs</SpecificName>
<Tooltip>Hero Aura: Increased Range and Attack for Siege Engines.</Tooltip>
<History>One of the Diadochi, king of Macedonia (294 BC - 288 BC), Demetrius was renowned as one of the bravest and most able successors of Alexander. As the son of Antigonus I Monophtalmus, he fought and won many important battles early on and was proclaimed king, along with his father, in 306 BC. Losing his Asian possessions after the battle of Ipsus, he later won the Macedonian throne. Fearing lest they should be overpowered by Demetrius, the other Diadochi united against him and defeated him.</History>
<Icon>units/hele_hero_demetrius.png</Icon>

View File

@ -8,8 +8,8 @@
</Auras>
<Identity>
<Civ>hele</Civ>
<GenericName>Philip II of Macedon</GenericName>
<SpecificName>Phílippos B' ho Makedn</SpecificName>
<GenericName>Philip II of Macedon</GenericName>
<SpecificName>Phílippos B' ho Makedṓn</SpecificName>
<Tooltip>Hero Aura: Increased Attack for Champion Units.</Tooltip>
<History>The king of Macedonia (359 BC - 336 BC), he carried out vast monetary and military reforms in order to make his kingdom the most powerful force in the Greek world. Greatly enlarged the size of Macedonia by conquering much of Thrace and subduing the Greeks. Murdered in Aegae while planning a campaign against Persia.</History>
<Icon>units/hele_hero_philip.png</Icon>

View File

@ -19,9 +19,9 @@
</Cost>
<Identity>
<Civ>hele</Civ>
<SelectionGroupName>units/hele_infantry_javelinist_b</SelectionGroupName>
<GenericName>Thracian Peltast</GenericName>
<SpecificName>Peltasts Thrâx</SpecificName>
<SelectionGroupName>units/hele_infantry_javelinist_b</SelectionGroupName>
<GenericName>Thracian Peltast</GenericName>
<SpecificName>Peltastḗs Thrâx</SpecificName>
<History>Peltasts were javelinists originating in Thrace but their form of combat was widely copied by the Hellenes, Macedonians, and Persians. Equipped with a small oval or crescent shield, a peltast would charge at enemy formations whilst hurling his javelins then fall back to avoid close combat. They wore no armor and were at a significant disadvantage against heavy infantry and cavalry, relying on their speed and skill for survival. Thracians sold their services to Hellene cities as mercenaries and added a much needed ranged and skirmishing ability to Hellenic armies.</History>
<Icon>units/hele_infantry_javelinist.png</Icon>
</Identity>

View File

@ -6,7 +6,7 @@
</Footprint>
<Identity>
<Civ>hele</Civ>
<SpecificName>Oxybels</SpecificName>
<SpecificName>Oxybelḗs</SpecificName>
<Icon>units/hele_mechanical_siege_oxybeles.png</Icon>
</Identity>
<Obstruction>

View File

@ -2,8 +2,8 @@
<Entity parent="template_unit_mechanical_ship_trireme">
<Identity>
<Civ>hele</Civ>
<SpecificName>Trirēs</SpecificName>
<Tooltip>Medium Warship.
<SpecificName>Triḗrēs</SpecificName>
<Tooltip>Medium Warship.
Ramming Secondary Attack.</Tooltip>
<History>The first Triremes were built circa 650BC, and by 500BC the Trireme was the most widely used heavy warship of the Greek city-states. In the Trireme the outriggers were now an integral part of the ship's hull. The Trireme also had a partial or full fighting deck above the rowers. The length of the Trireme remained approximately 35-38 meters, and the beam was approximately 3.5 metres. A Trireme carried 170 oarsmen, plus twenty sailors and fourteen marines in Greek navies. The top speed of a Trireme was approximately 11.5 knots. Some Triremes may have been able to reach higher speeds in short bursts. A Trireme travelling from Athens to Mitylene in 427BC made the 350 kilometre trip in only 24 hours, averaging eight knots (14.6 km/h). The Trireme could accelerate much faster than a Bireme or Penteconter, and was much more manoeuvrable. This gave the Trireme an advantage in combat, where higher speed and manoeuvrability meant a better chance of victory.</History>
<Icon>units/hele_ship_trireme.png</Icon>

View File

@ -4,7 +4,7 @@
<Civ>rome</Civ>
<SpecificName>Matrona Romana</SpecificName>
<Icon>units/rome_support_female_citizen.png</Icon>
<History>Roman women in the Republic were in a similar state as their Greek counterparts. When a Roman woman married their dowry and property passed to their father-in-law, while she herself became the property of her husband. Their job was to raise the children and helping in farm work or running the family business. It was a sign of affluence when a man’s wife did not have to work.</History>
<History>Roman women in the Republic were in a similar state as their Greek counterparts. When a Roman woman married their dowry and property passed to their father-in-law, while she herself became the property of her husband. Their job was to raise the children and helping in farm work or running the family business. It was a sign of affluence when a man's wife did not have to work.</History>
</Identity>
<VisualActor>
<Actor>units/romans/female_citizen.xml</Actor>

View File

@ -3,7 +3,7 @@
<Identity>
<Civ>rome</Civ>
<SpecificName>Plebean</SpecificName>
<History>Plebians were the poor class in Roman society, underneath the patricians, often carrying out much local trading and business. While patricians financed large business ventures plebian merchants did the actual work. They traded far and wide, from Iberia to Syria, buying and selling everything from salt to wool to horses to metals to glass to slaves. Rome’s extensive network of roads within Italy, many ports, and central location within the Mediterranean made it an ideal place to do business.</History>
<History>Plebians were the poor class in Roman society, underneath the patricians, often carrying out much local trading and business. While patricians financed large business ventures plebian merchants did the actual work. They traded far and wide, from Iberia to Syria, buying and selling everything from salt to wool to horses to metals to glass to slaves. Rome's extensive network of roads within Italy, many ports, and central location within the Mediterranean made it an ideal place to do business.</History>
</Identity>
<VisualActor>
<Actor>units/romans/trader.xml</Actor>

View File

@ -0,0 +1,18 @@
# Dumps lines containing the name of a font followed by a space-separated
# list of decimal codepoints (from U+0001 to U+FFFF) for which that font
# contains some glyph data.
import FontLoader
def dump_font(ttf):
(face, indexes) = FontLoader.create_cairo_font_face_for_file("../../../binaries/data/tools/fontbuilder/fonts/%s" % ttf, 0, FontLoader.FT_LOAD_DEFAULT)
mappings = [ (c, indexes(unichr(c))) for c in range(1, 65535) ]
print ttf,
print ' '.join(str(c) for (c, g) in mappings if g != 0)
dump_font("DejaVuSansMono.ttf")
dump_font("DejaVuSans.ttf")
dump_font("texgyrepagella-regular.otf")
dump_font("texgyrepagella-bold.otf")

View File

@ -1,3 +1,10 @@
# Tests the characters contained within entity template XML files (most usefully
# their <SpecificName>s) against the characters included in the bitmap font subset,
# and against the glyph data in the fonts themselves.
# When unsupported characters are reported, you should either edit the XML files
# to avoid them (e.g. use a codepoint that better corresponds to the character,
# or use a NFC or NFD version of the character) or add them to charset.txt.
use strict;
use warnings;
@ -30,6 +37,19 @@ $chars{"\r"} = undef;
$chars{"\n"} = undef;
$chars{"\t"} = undef;
my %fontchars;
{
open my $f, 'python dumpfontchars.py|' or die $!;
while (<$f>)
{
my ($name, @chars) = split;
push @chars, 0x0009, 0x000A, 0x000D;
@{$fontchars{$name}}{map chr($_), @chars} = ();
}
}
delete $chars{chr(0x301)};
for my $fn (sort(find_entities()))
{
open my $f, "<", $fn or die $!;
@ -38,9 +58,23 @@ for my $fn (sort(find_entities()))
@fchars{split //, do { local $/; <$f> }} = ();
for (sort keys %fchars)
{
my @missing;
if (not exists $chars{$_})
{
printf "%s\n# Missing char U+%04X\n\n", $fn, ord $_;
push @missing, 'charset';
}
for my $font (sort keys %fontchars)
{
if (not exists $fontchars{$font}{$_})
{
push @missing, $font;
}
}
if (@missing)
{
printf "%s\n# Missing char U+%04X from %s\n\n", $fn, ord($_), (join ', ', @missing);
}
}
}
print "Done.\n";