Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Support mei2score conversion of Symbol characters
Browse files Browse the repository at this point in the history
  • Loading branch information
th-we committed Oct 31, 2014
1 parent 5629e69 commit b0ccfd9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Resources/public/js/monodi/mei2score.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
<param name="standardFont" select="'_80'"/>
<param name="smallCapsFont" select="'_85'"/>
<param name="corpusMonodicumFont" select="'_79'"/>

<param name="corpusMonodicumSymbolFont" select="'_86'"/>

<param name="standardAnnotP4" select="18"/>
<param name="standardDiacriticalMarkingP4" select="$standardAnnotP4"/>
<param name="lyricsAnnotP4" select="$lyricsP4 - 4"/>
Expand Down Expand Up @@ -432,6 +433,7 @@


<template mode="generate-score-escaped-string" match="node()|@*">
<!-- TODO: Improve support for Symbol font characters, i.e. complete conversion of the available character set. -->
<param name="string" select="normalize-space(.)"/>
<param name="trailingCharactersToOmit" select="''"/>
<param name="allCaps" select="false()"/>
Expand All @@ -448,7 +450,9 @@
<variable name="char" select="substring($string,1,1)"/>
<variable name="firstTwoChars" select="substring($string,1,2)"/>
<variable name="unescapedChars">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,():;?!+-*=@#$%&amp;&lt;&gt;`'"</variable>

<variable name="symbolFontChars" >ęĘαβχδεφγηιφκλμνοπθρστυπωξψζ</variable>
<variable name="symbolFontCharTranslations">'"abcdefghijklmnopqrstuvwxyz</variable>

<variable name="escapedChar">
<choose>
<!-- We replace < and > with these characters from the Corpus Monodicum font -->
Expand Down Expand Up @@ -529,6 +533,15 @@
<when test="$char='^'">\\303</when>
<when test="$char='~'">\\304</when>
<when test="$char='&#160;'"> </when><!-- "&nbsp;" -->
<when test="$char='ę' and $font = $smallCapsFont">
<value-of select="concat($corpusMonodicumSymbolFont, '@', $font)"/>
</when>
<when test="contains($symbolFontChars, $char)">
<value-of select="concat(
$corpusMonodicumSymbolFont,
translate($char, $symbolFontChars, $symbolFontCharTranslations),
$font)"/>
</when>
<otherwise>
<value-of select="'?'"/>
<message>
Expand Down

0 comments on commit b0ccfd9

Please sign in to comment.