@@ -14,8 +14,6 @@ tcltest::loadTestedCommands
1414# Some tests require support for 4-byte UTF-8 sequences
1515testConstraint fullutf [expr {[format %c 0x010000] != "\uFFFD"}]
1616testConstraint utfcompat [expr {([string length "\U10000"] == 2) && [package vsatisfies [package provide Tcl] 8]}]
17- testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
18-
1917set defaultfontlist [font names]
2018
2119proc getnondefaultfonts {} {
@@ -130,15 +128,15 @@ test font-4.6 {font command: actual: arguments} -body {
130128 # (objc - skip > 4) when skip == 2
131129 font actual xyz -displayof . abc def
132130} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?-option? ?--? ?char?"}
133- test font-4.7 {font command: actual: arguments} -constraints noExceed - body {
131+ test font-4.7 {font command: actual: arguments} -body {
134132 # (tkfont == NULL)
135133 font actual "\{xyz"
136134} -returnCodes error -result "font \"{xyz\" does not exist"
137135test font-4.8 {font command: actual: all attributes} -body {
138136 # not (objc > 3) so objPtr = NULL
139137 lindex [font actual {-family times}] 0
140138} -result {-family}
141- test font-4.9 {font command: actual} -constraints {unix noExceed failsOnUbuntu } -body {
139+ test font-4.9 {font command: actual} -constraints {haveTimesFamilyFont } -body {
142140 # (objc > 3) so objPtr = objv[3 + skip]
143141 string tolower [font actual {-family times} -family]
144142} -result {times}
@@ -384,7 +382,7 @@ test font-8.3 {font command: families: arguments} -body {
384382 # (objc - skip != 2) when skip == 2
385383 font families -displayof . xyz
386384} -returnCodes error -result {wrong # args: should be "font families ?-displayof window?"}
387- test font-8.4 {font command: families} -constraints failsOnUbuntu -body {
385+ test font-8.4 {font command: families} -constraints haveTimesFamilyFont -body {
388386 # TkpGetFontFamilies()
389387 regexp -nocase times [font families]
390388} -result 1
@@ -402,7 +400,7 @@ test font-9.3 {font command: measure: arguments} -body {
402400 # (objc - skip != 4)
403401 font measure xyz abc def
404402} -returnCodes error -result {wrong # args: should be "font measure font ?-displayof window? text"}
405- test font-9.4 {font command: measure: arguments} -constraints noExceed - body {
403+ test font-9.4 {font command: measure: arguments} -body {
406404 # (tkfont == NULL)
407405 font measure "\{xyz" abc
408406} -returnCodes error -result "font \"{xyz\" does not exist"
@@ -440,7 +438,7 @@ test font-10.5 {font command: metrics: arguments} -body {
440438 # (objc - skip) > 4) when skip == 2
441439 font metrics xyz -displayof . abc
442440} -returnCodes error -result {bad metric "abc": must be -ascent, -descent, -fixed, or -linespace}
443- test font-10.6 {font command: metrics: bad font} -constraints noExceed - body {
441+ test font-10.6 {font command: metrics: bad font} -body {
444442 # (tkfont == NULL)
445443 font metrics "\{xyz"
446444} -returnCodes error -result "font \"{xyz\" does not exist"
@@ -704,7 +702,7 @@ test font-15.9 {Tk_AllocFontFromObj procedure: get attribute font} -setup {
704702} -cleanup {
705703 destroy .t.f
706704} -returnCodes error -result {expected integer but got "yyy"}
707- test font-15.10 {Tk_AllocFontFromObj procedure: no match} -constraints noExceed - body {
705+ test font-15.10 {Tk_AllocFontFromObj procedure: no match} -body {
708706 # (ParseFontNameObj() != TCL_OK)
709707 font actual "\{xyz"
710708} -returnCodes error -result "font \"{xyz\" does not exist"
@@ -936,11 +934,15 @@ test font-21.5 {Tk_PostscriptFontName procedure: spaces} -constraints {
936934 }
937935} -result {LucidaBright}
938936test font-21.6 {Tk_PostscriptFontName procedure: spaces} -constraints {
939- x11 failsOnUbuntu
937+ x11
940938} -body {
941- psfontname "{new century schoolbook} 10"
939+ set name {{new century schoolbook} 10}
940+ if {[font actual {{new century schoolbook} 10} -family] == "new century schoolbook"} {
941+ set x [psfontname "{new century schoolbook} 10"]
942+ } else {
943+ set x NewCenturySchlbk-Roman
944+ }
942945} -result {NewCenturySchlbk-Roman}
943-
944946test font-21.7 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
945947 unix
946948} -body {
@@ -2252,10 +2254,10 @@ test font-38.5 {ParseFontNameObj procedure: begins with *} -body {
22522254test font-38.6 {ParseFontNameObj procedure: begins with *} -body {
22532255 font actual *-times-xyz -family
22542256} -result [font actual {times 0} -family]
2255- test font-38.7 {ParseFontNameObj procedure: arguments} -constraints noExceed - body {
2257+ test font-38.7 {ParseFontNameObj procedure: arguments} -body {
22562258 font actual "\{xyz"
22572259} -returnCodes error -result "font \"{xyz\" does not exist"
2258- test font-38.8 {ParseFontNameObj procedure: arguments} -constraints noExceed - body {
2260+ test font-38.8 {ParseFontNameObj procedure: arguments} -body {
22592261 font actual ""
22602262} -returnCodes error -result {font "" does not exist}
22612263test font-38.9 {ParseFontNameObj procedure: arguments} -body {
@@ -2265,7 +2267,7 @@ test font-38.10 {ParseFontNameObj procedure: arguments} -body {
22652267 font actual {times xyz xyz}
22662268} -returnCodes error -result {expected integer but got "xyz"}
22672269test font-38.11 {ParseFontNameObj procedure: stylelist loop} -constraints {
2268- unixOrWin haveTimes12BoldItalicUnderlineOverstrikeFont
2270+ unixOrWin haveBoldItalicUnderlineOverstrikeFont
22692271} -body {
22702272 lrange [font actual {times 12 bold italic overstrike underline}] 4 end
22712273} -result {-weight bold -slant italic -underline 1 -overstrike 1}
@@ -2356,14 +2358,15 @@ test font-44.1 {TkFontGetPixels: size < 0} -setup {
23562358} -cleanup {
23572359 tk scaling $oldscale
23582360} -result 26
2359- test font-44.2 {TkFontGetPoints: size >= 0} -constraints {noExceed haveTimes12Font} - setup {
2361+ test font-44.2 {TkFontGetPoints: size >= 0} -setup {
23602362 set oldscale [tk scaling]
23612363} -body {
2364+ set oldSize [font actual {times 12} -size]
23622365 tk scaling 0.5
2363- font actual {times 12} -size
2366+ expr {[ font actual {times 12} -size] == $oldSize}
23642367} -cleanup {
23652368 tk scaling $oldscale
2366- } -result 12
2369+ } -result 1
23672370test font-44.3 {font create with display scaling not 100% - bug 8162e9b7a9} -body {
23682371 set font1 TkDefaultFont
23692372 set font2 [font create Font2 {*}[font actual $font1]]
@@ -2379,7 +2382,7 @@ test font-45.1 {TkFontGetAliasList: no match} -body {
23792382test font-45.2 {TkFontGetAliasList: match} -constraints win -body {
23802383 font actual {times 10} -family
23812384} -result {times}
2382- test font-45.3 {TkFontGetAliasList: match} -constraints {noExceed failsOnUbuntu} -body {
2385+ test font-45.3 {TkFontGetAliasList: match} -constraints haveTimesFamilyFont -body {
23832386 if {[font actual {{times new roman} 10} -family] eq "Times New Roman"} {
23842387 # avoid test failure on systems that have a real "times new roman" font
23852388 set res 1
0 commit comments