<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font face="Georgia">A bit more on what's happening</font></p>
<p><font face="Georgia">If the font used (the default font in the
example below) is a StrikeFont, then this<br>
</font></p>
<p><font face="Georgia">f1 _ Form extent: 100@100 depth: 32.<br>
f1 fillColor: Color green.<br>
Form allInstancesDo: [ :f | f hibernate].<br>
f1 getCanvas drawString: 'Black on green' in: (0@0 extent:
100@100) font: nil color: Color black.<br>
f1 asMorph openInWorld.<br>
</font></p>
<p>draws black text on a white rectangle on a larger green
rectangle. StrikeFonts are drawn (in depth 32, anyway) by a
primitive using rule 34. If the primitive fails, then #copyBits is
used character by character.<br>
</p>
primDisplayString: aString from: startIndex to: stopIndex map:
glyphMap xTable: xTable kern: kernDelta<br>
| ascii |<br>
<primitive:'primitiveDisplayString' module:'BitBltPlugin'><br>
startIndex to: stopIndex do:[:charIndex|<br>
ascii := (aString at: charIndex) asciiValue.<br>
glyphMap ifNotNil:[ascii := glyphMap at: ascii+1].<br>
sourceX := xTable at: ascii + 1.<br>
width := (xTable at: ascii + 2) - sourceX.<br>
self copyBits.<br>
destX := destX + width + kernDelta.<br>
].<br>
<br>
It seems like rule 34 is handled differently by
primitiveDisplayString and primitiveCopyBits. If I add code as
exists elsewhere to unhibernate forms and retry, all is working as
expected:<br>
<br>
primDisplayString: aString from: startIndex to: stopIndex map:
glyphMap xTable: xTable kern: kernDelta<br>
| ascii |<br>
<primitive:'primitiveDisplayString' module:'BitBltPlugin'><br>
(sourceForm isForm and: [sourceForm unhibernate]) ifTrue: [<br>
^self primDisplayString: aString from: startIndex to:
stopIndex map: glyphMap xTable: xTable kern: kernDelta<br>
].<br>
(destForm isForm and: [destForm unhibernate]) ifTrue: [<br>
^self primDisplayString: aString from: startIndex to:
stopIndex map: glyphMap xTable: xTable kern: kernDelta<br>
].<br>
(halftoneForm isForm and: [halftoneForm unhibernate]) ifTrue: [<br>
^self primDisplayString: aString from: startIndex to:
stopIndex map: glyphMap xTable: xTable kern: kernDelta<br>
].<br>
startIndex to: stopIndex do:[:charIndex|<br>
ascii := (aString at: charIndex) asciiValue.<br>
glyphMap ifNotNil:[ascii := glyphMap at: ascii+1].<br>
sourceX := xTable at: ascii + 1.<br>
width := (xTable at: ascii + 2) - sourceX.<br>
self copyBits.<br>
destX := destX + width + kernDelta.<br>
].<br>
<br>
<div class="moz-cite-prefix">On 10/6/17 10:59 PM, Bob Arning wrote:<br>
</div>
<blockquote type="cite"
cite="mid:4a91c131-0650-c21b-60c5-39c95a3fdbc3@comcast.net">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<p><font face="Georgia">Here is a strange one. I noticed a few
morphs changing appearance after saving the image. It seems to
be related to the hibernation of Forms which happens prior to
saving the image. This snippet<br>
</font></p>
<p><font face="Georgia">(m := SimpleButtonMorph new)<br>
label: 'Black on yellow';<br>
color: Color yellow.<br>
Form allInstancesDo: [ :f | f hibernate]. "this happens
when saving image"<br>
m imageForm asMorph openInWorld</font></p>
<p>has a white background for the text with a bit of yellow
surrounding it. Running it in a clean 5.1 image gets the
expected result: black text on a yellow background. However, if
I load the preferences from my current image into the clean
image, then the problem occurs: black on white on yellow. My
prefs are attached if you would like to take a stab at it (and
if it isn't too large an attachment).</p>
<p><br>
</p>
</blockquote>
<br>
</body>
</html>