Skip to content

Commit

Permalink
Fix OpenDyslexic font injection
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Mar 5, 2024
1 parent b50e959 commit 13c30b7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
18 changes: 12 additions & 6 deletions README-CHANGES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
<c:change date="2023-10-06T00:00:00+00:00" summary="Added highlighting feature to searching terms on EPUB pages."/>
</c:changes>
</c:release>
<c:release date="2024-02-26T00:00:00+00:00" is-open="false" ticket-system="org.lyrasis.jira" version="3.0.0">
<c:changes>
<c:change date="2023-11-17T00:00:00+00:00" summary="Updated Readium version."/>
<c:change date="2024-02-26T00:00:00+00:00" summary="Upgrade to Readium 2 3.0.0 (alpha)"/>
</c:changes>
</c:release>
<c:release date="2022-12-08T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="1.0.3">
<c:changes>
<c:change date="2022-10-05T00:00:00+00:00" summary="Added content description to back button on reader screen"/>
Expand All @@ -61,15 +67,15 @@
<c:release date="2023-11-03T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="2.1.1">
<c:changes/>
</c:release>
<c:release date="2024-02-26T00:00:00+00:00" is-open="false" ticket-system="org.lyrasis.jira" version="3.0.0">
<c:release date="2024-03-05T10:43:04+00:00" is-open="true" ticket-system="org.lyrasis.jira" version="3.1.0">
<c:changes>
<c:change date="2023-11-17T00:00:00+00:00" summary="Updated Readium version."/>
<c:change date="2024-02-26T00:00:00+00:00" summary="Upgrade to Readium 2 3.0.0 (alpha)"/>
<c:change date="2024-03-05T10:43:04+00:00" summary="Fix OpenDyslexic font injection.">
<c:tickets>
<c:ticket id="PP-1015"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
<c:release date="2024-02-26T11:11:46+00:00" is-open="true" ticket-system="org.lyrasis.jira" version="3.0.1">
<c:changes/>
</c:release>
</c:releases>
<c:ticket-systems>
<c:ticket-system default="true" id="org.lyrasis.jira" url="https://ebce-lyrasis.atlassian.net/browse/"/>
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ POM_SCM_CONNECTION=scm:git:git://github.com/ThePalaceProject/android-r2
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/ThePalaceProject/android-r2
POM_SCM_URL=http://github.com/ThePalaceProject/android-r2
POM_URL=http://github.com/ThePalaceProject/android-r2
VERSION_NAME=3.0.1-SNAPSHOT
VERSION_NAME=3.1.0-SNAPSHOT
VERSION_PREVIOUS=3.0.0

android.useAndroidX=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class SR2HtmlInjectingResource(
resourceHtml = StringBuilder(resourceHtml).insert(endHeadIndex, element).toString()
endHeadIndex += element.length
}
resourceHtml = StringBuilder(resourceHtml).insert(endHeadIndex, getHtmlFont(fontFamily = "OpenDyslexic", href = "/fonts/OpenDyslexic-Regular.otf")).toString()
resourceHtml = StringBuilder(resourceHtml).insert(endHeadIndex, getHtmlFont(fontFamily = "OpenDyslexic", href = "fonts/OpenDyslexic-Regular.otf")).toString()
resourceHtml = StringBuilder(resourceHtml).insert(endHeadIndex, "<style>@import url('https://fonts.googleapis.com/css?family=PT+Serif|Roboto|Source+Sans+Pro|Vollkorn');</style>\n").toString()
resourceHtml = applyDirectionAttribute(resourceHtml, this.publication.manifest)
return resourceHtml
Expand Down Expand Up @@ -138,7 +138,7 @@ class SR2HtmlInjectingResource(
): String {
val prefix = "<style type=\"text/css\"> @font-face{font-family: \"$fontFamily\"; src:url(\""
val suffix = "\") format('truetype');}</style>\n"
return prefix + href + suffix
return prefix + PREFIX_ASSETS + href + suffix
}

private fun linkToCSS(resourceName: String): String {
Expand Down

0 comments on commit 13c30b7

Please sign in to comment.