use dejavu serif for cyrrylic
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 5 Jan 2011 15:53:28 +0000 (16:53 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 5 Jan 2011 15:53:28 +0000 (16:53 +0100)
librarian/pdf.py
librarian/pdf/wl.sty
librarian/xslt/wl2tex.xslt

index 2d45372..07272f2 100644 (file)
@@ -282,7 +282,10 @@ def load_including_children(provider, slug=None, uri=None, file_path=None):
     else:
         raise ValueError('Neither slug, URI nor file path provided for a book.')
 
-    document = WLDocument.from_file(f, True,
+    text = f.read().decode('utf-8')
+    text = re.sub(ur"([\u0400-\u04ff]+)", ur"<alien>\1</alien>", text)
+
+    document = WLDocument.from_string(text, True,
         parse_dublincore=True)
 
     f.close()
index e676b8d..687efde 100644 (file)
@@ -24,6 +24,14 @@ Scale=1.04,
 LetterSpace=-1.0
 ] {JunicodeWL}
 
+\newfontfamily\alien[
+SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
+Numbers=OldStyle,
+Scale=0.85,
+LetterSpace=-1.0
+] {DejaVu Serif}
+
+
 \defaultfontfeatures{
 SizeFeatures={
   {Size={-10}, FakeStretch=1.02, LetterSpace=2.0 },
index f5e137f..c3abdd6 100644 (file)
     <spec cat="tilde" />
 </xsl:template>
 
+<xsl:template match="alien" mode="inline">
+    <group>
+        <cmd name="alien" />
+        <xsl:apply-templates mode="inline" />
+    </group>
+</xsl:template>
+
 <!-- ================ -->
 <!-- = IGNORED TAGS = -->
 <!-- ================ -->