mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix some bugs converting from font name to css font style info
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18214 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
fe0c1f1f85
commit
3a5149fb32
@ -44,10 +44,13 @@
|
||||
(len (string-length font-name))
|
||||
(idx 0)
|
||||
)
|
||||
(gnc:debug font-name)
|
||||
(set! idx (string-index-right font-name (string->char-set "0123456789")))
|
||||
(set! font-size (substring font-name (- idx 1) len))
|
||||
(set! font-name (string-take font-name (- idx 2)))
|
||||
(gnc:debug "'" font-name "'")
|
||||
(set! idx (string-index-right font-name #\space))
|
||||
(gnc:debug idx)
|
||||
(set! font-size (substring font-name (+ idx 1) len))
|
||||
(gnc:debug "font-size '" font-size "'")
|
||||
(set! font-name (string-take font-name idx))
|
||||
(gnc:debug "font-name: '" font-name "'")
|
||||
(set! font-weight-idx (string-contains-ci font-name " bold"))
|
||||
(if font-weight-idx
|
||||
(begin
|
||||
@ -55,6 +58,8 @@
|
||||
(set! font-name (string-append (string-take font-name font-weight-idx)
|
||||
(string-drop font-name (+ font-weight-idx 5))))
|
||||
))
|
||||
(gnc:debug "font-name: '" font-name "'")
|
||||
(gnc:debug "font-weight: " font-weight)
|
||||
(set! font-style-idx (string-contains-ci font-name " italic"))
|
||||
(if font-style-idx
|
||||
(begin
|
||||
@ -62,6 +67,8 @@
|
||||
(set! font-name (string-append (string-take font-name font-style-idx)
|
||||
(string-drop font-name (+ font-style-idx 7))))
|
||||
))
|
||||
(gnc:debug "font-name: '" font-name "'")
|
||||
(gnc:debug "font-style: " font-style)
|
||||
(set! font-family font-name)
|
||||
(set! result (string-append
|
||||
"font-family: " font-family "; "
|
||||
|
Loading…
Reference in New Issue
Block a user