Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Pod/Classes/Highlightr.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ open class Highlightr
- returns: true if it was possible to set the given theme, false otherwise
*/
@discardableResult
open func setTheme(to name: String) -> Bool
open func setTheme(to name: String, withFont font: RPFont = RPFont(name: "Courier", size: 14)!) -> Bool
{
guard let defTheme = bundle.path(forResource: name+".min", ofType: "css") else
{
return false
}
let themeString = try! String.init(contentsOfFile: defTheme)
theme = Theme(themeString: themeString)
theme = Theme(themeString: themeString, font: font)


return true
Expand Down
4 changes: 2 additions & 2 deletions Pod/Classes/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ open class Theme {

- parameter themeString: Theme to use.
*/
init(themeString: String)
init(themeString: String, font: RPFont)
{
theme = themeString
setCodeFont(RPFont(name: "Courier", size: 14)!)
setCodeFont(font)
strippedTheme = stripTheme(themeString)
lightTheme = strippedThemeToString(strippedTheme)
themeDict = strippedThemeToTheme(strippedTheme)
Expand Down