Posted to tcl by patthoyts at Wed May 13 21:09:36 GMT 2009view raw

  1. Index: generic/tkFont.c
  2. ===================================================================
  3. RCS file: /cvsroot/tktoolkit/tk/generic/tkFont.c,v
  4. retrieving revision 1.53
  5. diff -u -r1.53 tkFont.c
  6. --- generic/tkFont.c 3 Feb 2009 23:55:47 -0000 1.53
  7. +++ generic/tkFont.c 13 May 2009 21:06:01 -0000
  8. @@ -3608,6 +3608,20 @@
  9. if (result == TCL_OK) {
  10. return TCL_OK;
  11. }
  12. +
  13. + /*
  14. + * If the string failed to parse but was considered to be a XLFD
  15. + * then it may be a "-option value" string with a hyphenated family
  16. + * name as per bug 2791352
  17. + */
  18. +
  19. + if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
  20. + return TCL_ERROR;
  21. + }
  22. +
  23. + if (ConfigAttributesObj(interp, tkwin, objc, objv, faPtr) == TCL_OK) {
  24. + return TCL_OK;
  25. + }
  26. }
  27.  
  28. /*
  29. Index: tests/font.test
  30. ===================================================================
  31. RCS file: /cvsroot/tktoolkit/tk/tests/font.test,v
  32. retrieving revision 1.19
  33. diff -u -r1.19 font.test
  34. --- tests/font.test 15 Aug 2008 01:10:03 -0000 1.19
  35. +++ tests/font.test 13 May 2009 21:08:29 -0000
  36. @@ -2221,6 +2221,12 @@
  37. test font-38.12 {ParseFontNameObj procedure: stylelist error} -body {
  38. font actual {times 12 bold xyz}
  39. } -returnCodes error -result {unknown font style "xyz"}
  40. +test font-38.13 "ParseFontNameObj: options with hyphenated family: bug #2791352" -body {
  41. + font actual {-family sans-serif -size 12 -weight bold -slant roman -underline 0 -overstrike 0}
  42. +} -returnCodes ok -result [font actual {sans-serif 12 bold}]
  43. +test font-38.14 "ParseFontNameObj: bug #2791352" -body {
  44. + font actual {-invalidfont 8 bold}
  45. +} -returnCodes error -match glob -result {bad option "-invalidfont": *}
  46.  
  47.  
  48. test font-39.1 {NewChunk procedure: test realloc} -setup {

Comments

Posted by Emiliano at Wed May 13 21:19:42 GMT 2009 [text] [code]

Warning: ttkStubInit.c may be out of date. Developers may want to run "make genstubs" to regenerate. This warning can be safely ignored, do not report as a bug! LD_LIBRARY_PATH="`pwd`:/home/emiliano/src/tcl/unix:${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH; TCL_LIBRARY=/home/emiliano/src/tcl/library; export TCL_LIBRARY; TK_LIBRARY=/home/emiliano/src/tk/library; export TK_LIBRARY; ./tktest /home/emiliano/src/tk/unix/../tests/all.tcl -geometry +0+0 -file font.test Tests running in interp: /home/emiliano/src/tk/unix/tktest Tests located in: /home/emiliano/src/tk/tests Tests running in: /home/emiliano/src/tk/unix Temporary files stored in /home/emiliano/src/tk/unix Test files sourced into current interpreter Running tests that match: * Skipping test files that match: l.*.test Only running test files that match: font.test Tests began at Wed May 13 18:19:22 ART 2009 font.test ==== font-17.5 Tk_FreeFont procedure: named font FAILED ==== Contents of test case: # not (fontPtr->refCount == 0) font create xyz -underline 1 .t.f config -font xyz font delete xyz set x [font actual xyz -underline] destroy .t.f list [font actual xyz -underline] $x ---- Result was: 0 0 ---- Result should have been (exact matching): 0 1 ==== font-17.5 FAILED ==== font-24.5 Tk_ComputeTextLayout: break line FAILED ==== Contents of test case: .t.l config -text "000\t00000" -wrap [expr 9 * $ax] update list [expr {[winfo reqwidth .t.l] eq [expr {$ax * 8}]}] [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}] ---- Result was: 0 1 ---- Result should have been (exact matching): 1 1 ==== font-24.5 FAILED ==== font-38.11 ParseFontNameObj procedure: stylelist loop FAILED ==== Contents of test case: lrange [font actual {times 12 bold italic overstrike underline}] 4 end ---- Result was: -weight bold -slant italic -underline 0 -overstrike 0 ---- Result should have been (exact matching): -weight bold -slant italic -underline 1 -overstrike 1 ==== font-38.11 FAILED ==== font-44.1 TkFontGetPixels: size < 0 FAILED ==== Contents of test case: tk scaling 0.5 font actual {times -12} -size ---- Result was: -12 ---- Result should have been (exact matching): 24 ==== font-44.1 FAILED ==== font-45.3 TkFontGetAliasList: match FAILED ==== Contents of test case: # can fail on Unix systems that have a real "times new roman" font font actual {{times new roman} 10} -family ---- Result was: Liberation Serif ---- Result should have been (exact matching): Times ==== font-45.3 FAILED Tests ended at Wed May 13 18:19:29 ART 2009 all.tcl: Total 282 Passed 251 Skipped 26 Failed 5 Sourced 1 Test Files. Files with failing tests: font.test Number of tests skipped for each constraint: 26 win LD_LIBRARY_PATH="`pwd`:/home/emiliano/src/tcl/unix:${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH; TCL_LIBRARY=/home/emiliano/src/tcl/library; export TCL_LIBRARY; TK_LIBRARY=/home/emiliano/src/tk/library; export TK_LIBRARY; ./tktest /home/emiliano/src/tk/unix/../tests/ttk/all.tcl -geometry +0+0 \ -file font.test Tests running in interp: /home/emiliano/src/tk/unix/tktest Tests located in: /home/emiliano/src/tk/tests/ttk Tests running in: /home/emiliano/src/tk/unix Temporary files stored in /home/emiliano/src/tk/unix Test files sourced into current interpreter Running tests that match: * Skipping test files that match: l.*.test Only running test files that match: font.test Tests began at Wed May 13 18:19:29 ART 2009 Tests ended at Wed May 13 18:19:29 ART 2009 all.tcl: Total 0 Passed 0 Skipped 0 Failed 0 Sourced 0 Test Files.