Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
hdoc
Commits
a7c30e5b
Commit
a7c30e5b
authored
Dec 19, 2016
by
Baptiste Perraud
Browse files
Add Computer Modern font support via CSS
parent
9e71c987
Changes
3
Hide whitespace changes
Inline
Side-by-side
hdoc_to_pdf/css/main.css
View file @
a7c30e5b
/* Font declarations */
@font-face
{
font-family
:
"CMU Serif"
;
src
:
url(cmunrm.ttf)
;
font-weight
:
normal
;
font-style
:
normal
;
-fs-pdf-font-embed
:
embed
;
-fs-pdf-font-encoding
:
Identity-H
;
}
@font-face
{
font-family
:
"CMU Serif Extra"
;
src
:
url(cmunrb.ttf)
;
font-weight
:
bold
;
font-style
:
normal
;
-fs-pdf-font-embed
:
embed
;
-fs-pdf-font-encoding
:
Identity-H
;
}
@font-face
{
font-family
:
"CMU Serif"
;
src
:
url(cmunti.ttf)
;
font-weight
:
normal
;
font-style
:
italic
;
-fs-pdf-font-embed
:
embed
;
-fs-pdf-font-encoding
:
Identity-H
;
}
@font-face
{
font-family
:
"CMU Typewriter Text"
;
src
:
url(cmuntt.ttf)
;
font-weight
:
normal
;
font-style
:
normal
;
-fs-pdf-font-embed
:
embed
;
-fs-pdf-font-encoding
:
Identity-H
;
}
/* Global page styles */
@page
{
size
:
A4
portrait
;
margin
:
2cm
;
}
*
{
font-family
:
"CMU Serif"
;
}
hdoc_to_pdf/xsl/find_content.xsl
View file @
a7c30e5b
...
...
@@ -42,6 +42,10 @@
<echo
message=
"Dirpath : {$dirpath}"
/>
<copy
file=
"{$BaseDirectory}/css/main.css"
tofile=
"{$dirpath}/main.css"
/>
<copy
file=
"{$BaseDirectory}/font/cmunrm.ttf"
tofile=
"{$dirpath}/cmunrm.ttf"
/>
<copy
file=
"{$BaseDirectory}/font/cmunrb.ttf"
tofile=
"{$dirpath}/cmunrb.ttf"
/>
<copy
file=
"{$BaseDirectory}/font/cmunti.ttf"
tofile=
"{$dirpath}/cmunti.ttf"
/>
<copy
file=
"{$BaseDirectory}/font/cmuntt.ttf"
tofile=
"{$dirpath}/cmuntt.ttf"
/>
<xslt
in=
"{$TempDirectory}/{$path}"
out=
"{$dirpath}/hdoc_nsless.xhtml"
style=
"xsl/ns_remover.xsl"
classpath=
"./lib/saxon9he.jar"
/>
<xslt
in=
"{$dirpath}/hdoc_nsless.xhtml"
out=
"{$dirpath}/flat_hdoc.xhtml"
style=
"xsl/hdoc_flattenizer.xsl"
classpath=
"./lib/saxon9he.jar"
/>
...
...
hdoc_to_pdf/xsl/hdoc_flattenizer.xsl
View file @
a7c30e5b
...
...
@@ -26,9 +26,10 @@
<head>
<xsl:apply-templates
select=
"node()|@*"
/>
<link>
<xsl:attribute
name=
"re
f
"
>
stylesheet
</xsl:attribute>
<xsl:attribute
name=
"re
l
"
>
stylesheet
</xsl:attribute>
<xsl:attribute
name=
"type"
>
text/css
</xsl:attribute>
<xsl:attribute
name=
"href"
>
css/main.css
</xsl:attribute>
<xsl:attribute
name=
"href"
>
main.css
</xsl:attribute>
<xsl:attribute
name=
"media"
>
print
</xsl:attribute>
</link>
</head>
</xsl:template>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment