SUNScholar/XMLUI Theme/M2/Customisation/Typography
Back to Mirage 2 Customisation
Contents
Introduction
This wiki page has instructions on how to configure the fonts used in your custom Mirage 2 theme.
At Stellenbosch University we elected to use the free Ubuntu fonts.
Also see: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Theme/Fonts
Step 1 - Define fonts reference
Modify XSL to use custom fonts. Check the following link:
This is equivalent to:
nano $HOME/source/dspace-xmlui-mirage2/src/main/webapp/xsl/core/page-structure.xsl
Go to line 194 and insert the following:
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,bold"/>
Make sure to indent and format the insertion correctly.
Step 2 - Define fonts CSS
Modify CSS to use the custom fonts. Check the following link:
This is equivalent to:
nano $HOME/source/dspace-xmlui-mirage2/src/main/webapp/styles/classic_mirage_color_scheme/_bootstrap_variables.scss
Go to the bottom of the file and add the following:
/** * Fonts CSS **/ $font-family-base: "Ubuntu","Bitstream Vera Sans","DejaVu Sans",Tahoma; $font-family-serif: "Ubuntu","Bitstream Vera Sans","DejaVu Sans",Tahoma,serif; $font-family-sans-serif: "Ubuntu","Bitstream Vera Sans","DejaVu Sans",Tahoma,sans-serif; $font-family-monospace: "Ubuntu","Courier New",monospace; $font-size-base: 13px; $font-size-large: 14px; $font-size-small: 10px;
Step 3 - Define font headings CSS
Type the following:
nano $HOME/source/dspace-xmlui-mirage2/src/main/webapp/styles/classic_mirage_color_scheme/_bootstrap_variables.scss
Go to the bottom of the file and add the following:
**/ * Headings CSS **/ $font-size-h1: 2.0em; $font-size-h2: 1.8em; $font-size-h3: 1.4em; $font-size-h4: 1.2em; $font-size-h5: 1.0em; $font-size-h6: 0.8em; $headings-font-family: inherit; $headings-font-weight: 500; $headings-line-height: 1.1; $headings-color: inherit;
Adjust the settings to suit your institution.