self icon indicating copy to clipboard operation
self copied to clipboard

Properties for "label" Morph is broken.

Open ghost opened this issue 13 years ago • 4 comments

Create a new label with the morph factory. Try to open the Properties. It will fail with a traceback. "scalableFont" can't be found.

ghost avatar Nov 29 '10 21:11 ghost

Bump. Is this still valid?

krono avatar Jan 08 '13 17:01 krono

I don't get the error mentioned but I get a different one. The error is: 'value not found in collection. Receiver is: a vector.'

doublec avatar Sep 19 '13 04:09 doublec

I'm thinking this error might be different on Mac OS X vs X11 backends. The error I mention in the previous comment is because 'traits subPropertiesSheetMorph' method 'buildEnumeratedFieldNamed:Labels:Values:InitialValue:' looks up the list of fonts for the font the label morph is using but can't find it in the list.

The list is obtained from 'x11Globals fontFamily' (via a call to 'x11Globals scalableFont'. That list doesn't contain 'verdana' which the labelMorph is using. The fontFamily list has an undefinedSelector method which handles direct requests for fonts that don't exist and returns 'times'. Unfortunately the enumeration of the fonts that the buildEnumeratedFieldNamed method uses just lists the selectors of 'fontFamily' so treats the undefinedSelect method as a font name and hence the default handling never occurs.

I'll do a fix that returns 'times' from 'buildEnumerateFieldNamed' if the font can't be found in the list.

For the 'scalableFont' error mentioned in the first comment, I assume the Mac OS X backend doesn't have this slot. I'll investigate on a Mac later.

doublec avatar Sep 20 '13 10:09 doublec

I've done pull request 17 for the linux issue.

doublec avatar Sep 20 '13 10:09 doublec