# HG changeset patch # User Jan Vrany # Date 1474273334 -3600 # Node ID 7524cb18917f87f8547bbf0b6104565bc9fe6759 # Parent a4f0771a81a263988e330d440bd4c731dfdfc0a1# Parent 57a7dc5fde0c89508ad292d3a6102af192a2ada7 Merge diff -r a4f0771a81a2 -r 7524cb18917f HersheyFont.st --- a/HersheyFont.st Wed Sep 14 06:50:24 2016 +0200 +++ b/HersheyFont.st Mon Sep 19 09:22:14 2016 +0100 @@ -1,5 +1,3 @@ -"{ Encoding: utf8 }" - " COPYRIGHT (c) 1989 by Claus Gittinger All Rights Reserved @@ -164,17 +162,17 @@ romant.hmp times.rb japan.hmp japanese - (these are available via http/ftp and must be aquired from elsewhere due to + (these are available via http/ftp and must be acquired from elsewhere due to copyright restrictions - google for 'hersh.oc' or search for hershey in github). - - You should install those files in some font folder + + You should install those files in some font folder (see hersheyFontPath for a list of places where they are expected) - + [see also:] BitmapFont FontDescription Font - Support for hershey fonts is based on a freeware cd-rom distribution + Support for hershey fonts is based on a freeware cd-rom distribution by DEC. This disk contains the hershey outlines and glyph maps of the following fonts: @@ -187,12 +185,12 @@ Cyrillic: Complex Symbols: - Mathematical - Daggers - Astronomical - Astrological - Musical - Typesetting (ffl,fl,fi sorts of things) + Mathematical + Daggers + Astronomical + Astrological + Musical + Typesetting (ffl,fl,fi sorts of things) Miscellaneous: - Playing card suits - Meteorology @@ -255,114 +253,114 @@ aView openAndWait. aView backingStore:true. - HersheyFont showFont:(HersheyFont family:'hershey-astrology' - face:'bold' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-astrology' + face:'bold' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-music' - face:'bold' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-music' + face:'bold' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-meteorology' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-meteorology' + face:'medium' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-cursive' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-cursive' + face:'medium' + style:'roman' size:10) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-cursive' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-cursive' + face:'medium' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-cursive' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-cursive' + face:'medium' + style:'roman' size:48) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-script' - face:'bold' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-script' + face:'bold' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-times' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-times' + face:'medium' + style:'roman' size:12) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-times' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-times' + face:'medium' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-times' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-times' + face:'medium' + style:'roman' size:48) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-times' - face:'bold' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-times' + face:'bold' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-times' - face:'medium' - style:'italic' + HersheyFont showFont:(HersheyFont family:'hershey-times' + face:'medium' + style:'italic' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-times' - face:'bold' - style:'italic' + HersheyFont showFont:(HersheyFont family:'hershey-times' + face:'bold' + style:'italic' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-futura' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-futura' + face:'medium' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-futura' - face:'bold' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-futura' + face:'bold' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-markers' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-markers' + face:'medium' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-math1' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-math1' + face:'medium' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-math2' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-math2' + face:'medium' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-symbol' - face:'medium' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-symbol' + face:'medium' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-gothic-italian' - face:'bold' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-gothic-italian' + face:'bold' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-gothic-german' - face:'bold' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-gothic-german' + face:'bold' + style:'roman' size:24) in:aView - HersheyFont showFont:(HersheyFont family:'hershey-gothic-english' - face:'bold' - style:'roman' + HersheyFont showFont:(HersheyFont family:'hershey-gothic-english' + face:'bold' + style:'roman' size:24) in:aView ]. [exEnd] @@ -441,8 +439,8 @@ xPos := 0 "x". yPos := 0 "y". draw := false. "start with a skip" - w := ((moves at:1) asciiValue - $R asciiValue)" * aScale". - h := ($R asciiValue - (moves at:2) asciiValue)" negated * aScale". + w := ((moves at:1) codePoint - $R codePoint)" * aScale". + h := ($R codePoint - (moves at:2) codePoint)" negated * aScale". w := w negated * aScale * 2. h := h negated * aScale * 2. @@ -452,12 +450,12 @@ c1 == Character space ifTrue:[ draw := false ] ifFalse:[ - nX := "xPos +" ((c1 asciiValue - $R asciiValue) * aScale). - nY := "yPos +" (($R asciiValue - c2 asciiValue) negated * aScale). + nX := "xPos +" ((c1 codePoint - $R codePoint) * aScale). + nY := "yPos +" (($R codePoint - c2 codePoint) negated * aScale). draw ifTrue:[ - aGC displayLineFromX:((x + xPos) truncated "rounded") + aGC displayLineFromX:((x + xPos) truncated "rounded") y:((y + yPos) truncated "rounded") - toX:((x + nX) truncated "rounded") + toX:((x + nX) truncated "rounded") y:((y + nY) truncated "rounded"). ]. xPos := nX. @@ -469,7 +467,7 @@ "Smalltalk at:#v put:nil. Smalltalk at:#f put:nil. - v := View new realize. + v := View new realize. v clear. v font:(f := HersheyFont family:'hershey-times' face:'bold' style:'roman' size:12). @@ -489,7 +487,7 @@ ^ 0 ]. - h := ($R asciiValue - (moves at:2) asciiValue)" negated * aScale". + h := ($R codePoint - (moves at:2) codePoint)" negated * aScale". h := h negated * aScale * 2. ^ h @@ -507,7 +505,7 @@ ^ 0 ]. - w := ((moves at:1) asciiValue - $R asciiValue). + w := ((moves at:1) codePoint - $R codePoint). w := w negated * aScale * 2. ^ w @@ -586,17 +584,17 @@ '~/Downloads/fonts/hershey' ) do:[:each | |fn| - + fn := each asFilename. (fn / 'data') exists ifTrue:[^ fn pathName]. ]. - + ^ '/usr/local/fonts/hershey' " self hersheyFontPath " - + "Modified: 16.1.1997 / 18:24:35 / cg" ! @@ -666,8 +664,8 @@ x := x0. index1 to:index2 do:[:index | - self drawCharacter:(aString at:index) asciiValue in:aGC x:x y:y. - x := x + (self widthOfCharacter:(aString at:index) asciiValue) + self drawCharacter:(aString at:index) codePoint in:aGC x:x y:y. + x := x + (self widthOfCharacter:(aString at:index) codePoint) ] ! @@ -676,8 +674,8 @@ x := x0. aString do:[:character | - self drawCharacter:character asciiValue in:aGC x:x y:y. - x := x + (self widthOfCharacter:character asciiValue) + self drawCharacter:character codePoint in:aGC x:x y:y. + x := x + (self widthOfCharacter:character codePoint) ] ! @@ -685,7 +683,7 @@ |glyphNo| (ascii between:32 and:127) ifFalse:[^ self]. - + glyphNo := glyphs at:(ascii - 32 + 1). glyphNo isNil ifTrue:[^ self]. self class drawGlyph:glyphNo in:aGC x:x y:y scale:scale @@ -698,7 +696,7 @@ face := fac. style := st. size := sz. - scale := sz / 24 + scale := sz / 24 ! onDevice:aDevice @@ -737,8 +735,8 @@ setDevice:aDevice super setDevice:aDevice. scale isNil ifTrue:[ - scale := size / 24 - ]. + scale := size / 24 + ]. ascent := maxAscent := self ascentOn:aDevice. descent := maxDescent := self descentOn:aDevice. width := minWidth := maxWidth := self widthOn:aDevice. @@ -780,7 +778,7 @@ sumW := 0. aString do:[:character | - sumW := sumW + (self widthOfCharacter:character asciiValue) + sumW := sumW + (self widthOfCharacter:character codePoint) ]. ^ sumW ! @@ -793,7 +791,7 @@ (stop < start) ifTrue:[^ 0]. sumW := 0. start to:stop do:[:index | - sumW := sumW + (self widthOfCharacter:(aString at:index) asciiValue) + sumW := sumW + (self widthOfCharacter:(aString at:index) codePoint) ]. ^ sumW ! @@ -802,7 +800,7 @@ |glyphNo| (ascii between:32 and:127) ifFalse:[^ 0]. - + glyphNo := glyphs at:(ascii - 32 + 1). glyphNo isNil ifTrue:[^ 0]. ^ self class widthOfGlyph:glyphNo scale:scale diff -r a4f0771a81a2 -r 7524cb18917f WinPrinterContext.st --- a/WinPrinterContext.st Wed Sep 14 06:50:24 2016 +0200 +++ b/WinPrinterContext.st Mon Sep 19 09:22:14 2016 +0100 @@ -4193,7 +4193,7 @@ createFontFor:aFontName "a basic method for font allocation; this method allows - any font to be aquired (even those not conforming to + any font to be acquired (even those not conforming to standard naming conventions, such as cursor, fixed or k14)" %{