r18214 - gnucash/trunk/src/report/stylesheets - Fix some bugs converting from font name to css font style info
Phil Longstaff
plongstaff at code.gnucash.org
Fri Jul 17 21:53:15 EDT 2009
Author: plongstaff
Date: 2009-07-17 21:53:15 -0400 (Fri, 17 Jul 2009)
New Revision: 18214
Trac: http://svn.gnucash.org/trac/changeset/18214
Modified:
gnucash/trunk/src/report/stylesheets/stylesheet-css.scm
Log:
Fix some bugs converting from font name to css font style info
Modified: gnucash/trunk/src/report/stylesheets/stylesheet-css.scm
===================================================================
--- gnucash/trunk/src/report/stylesheets/stylesheet-css.scm 2009-07-17 22:36:53 UTC (rev 18213)
+++ gnucash/trunk/src/report/stylesheets/stylesheet-css.scm 2009-07-18 01:53:15 UTC (rev 18214)
@@ -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 "; "
More information about the gnucash-changes
mailing list