crackNum 3.21 → 3.22
raw patch · 4 files changed
+37/−10 lines, 4 files
Files
- CHANGES.md +10/−1
- GUI/tclGUI/crackNum.tcl +24/−6
- README.md +2/−2
- crackNum.cabal +1/−1
CHANGES.md view
@@ -1,7 +1,16 @@ * Hackage: <http://hackage.haskell.org/package/crackNum> * GitHub: <http://github.com/LeventErkok/crackNum/> -* Latest Hackage released version: 3.21, 2026-08-16+* Latest Hackage released version: 3.22, 2026-08-17++### Version 3.22, 2026-08-17++ * Fix text alignment in the Tcl/Tk GUI's entry fields. We asked for the `Courier`+ font, which on X11 is an alias that typically resolves to Nimbus Mono PS. Its+ ascent/descent split is lopsided (9/6 at size 11), and since an entry centers+ text on the linespace, the glyphs ended up hugging the top of the box with a+ large gap underneath. We now pick the first monospaced family that is actually+ installed, preferring ones with sane metrics. ### Version 3.21, 2026-08-16
GUI/tclGUI/crackNum.tcl view
@@ -227,11 +227,29 @@ } # ---------------------------------------------------------------------------+# Font selection+# ---------------------------------------------------------------------------+# Pick a monospaced family with sane vertical metrics. Plain "Courier" is an+# X11 alias that commonly resolves to Nimbus Mono PS, whose ascent/descent split+# is badly lopsided (9/6 at size 11). Since an entry centers on the linespace,+# that leaves the glyphs hugging the top of the box with a fat gap underneath.+proc pickMonoFamily {} {+ set installed {}+ foreach f [font families] { lappend installed [string tolower $f] }+ foreach want {"DejaVu Sans Mono" "Menlo" "Liberation Mono" "Consolas" "Courier New"} {+ if {[lsearch -exact $installed [string tolower $want]] >= 0} { return $want }+ }+ return "Courier"+}++set MONO [pickMonoFamily]++# --------------------------------------------------------------------------- # Font size helpers # --------------------------------------------------------------------------- proc applyFontSize {} {- global state- .output configure -font [list Courier $state(fontSize)]+ global state MONO+ .output configure -font [list $MONO $state(fontSize)] } proc zoomIn {} { incr ::state(fontSize); applyFontSize }@@ -314,7 +332,7 @@ button .top.help -text "?" -command { showOutput $::WELCOME } pack .top.help -side left -padx 2 -entry .top.val -textvariable state(value) -font {Courier 11} -width 28+entry .top.val -textvariable state(value) -font [list $MONO 11] -width 28 pack .top.val -side right -padx {0 4} bind .top.val <Return> crack @@ -398,7 +416,7 @@ label .main.side.custom.bw.l -text "Total width:" pack .main.side.custom.bw.l -side left entry .main.side.custom.bw.e -textvariable state(bitWidth) -width 6 -justify right \- -font {Courier 11}+ -font [list $MONO 11] pack .main.side.custom.bw.e -side right bind .main.side.custom.bw.e <Return> crack @@ -407,7 +425,7 @@ label .main.side.custom.ew.l -text "Exponent width:" pack .main.side.custom.ew.l -side left entry .main.side.custom.ew.e -textvariable state(expWidth) -width 6 -justify right \- -font {Courier 11}+ -font [list $MONO 11] pack .main.side.custom.ew.e -side right bind .main.side.custom.ew.e <Return> crack @@ -421,7 +439,7 @@ pack .main.out -side left -fill both -expand yes text .output -state disabled -wrap none \- -font [list Courier $state(fontSize)] \+ -font [list $MONO $state(fontSize)] \ -padx 8 -pady 8 \ -xscrollcommand {.main.out.sx set} \ -yscrollcommand {.main.out.sy set}
README.md view
@@ -1,4 +1,4 @@-## Decode/Encode Integers, Words, and IEE754 Floats+## Decode/Encode Integers, Words, and IEEE754 and other float formats On Hackage: http://hackage.haskell.org/package/crackNum @@ -45,7 +45,7 @@ $ crackNum -fdp 0xfc00 abc1 7F80 0001 ``` -### Example: Decode a custom (2+3) IEEE754 float from memory-layout+### Example: Decode a custom (2+3) float from memory-layout ``` $ crackNum -f2+3 0b10011 Satisfiable. Model:
crackNum.cabal view
@@ -1,6 +1,6 @@ Cabal-version : 2.2 Name : crackNum-Version : 3.21+Version : 3.22 Synopsis : Crack various integer and floating-point data formats Description : Crack IEEE-754 and other float formats and arbitrary sized words and integers, showing the layout. .