[squeak-dev] Rendering a text along an arc

karl ramberg karlramberg at gmail.com
Sun Dec 30 22:06:15 UTC 2018


TextMorph>>createParagraph is the method that broke the TextOnCurve
functionality.

It need a guard against applying wrapFlag.

There is also some bug with the bounds so the text will not redraw properly.

Something like this under will prevent the DNU but it will not fix the
issue with the text bounds.

TextMorph>>createParagraph

    self setProperty: #CreatingParagraph toValue: true.

    [
        self setDefaultContentsIfNil.

        "...Code here to recreate the paragraph..."
        paragraph := (self paragraphClass new textOwner: self owner).
        paragraph wantsColumnBreaks: successor notNil.
        paragraph
            compose: text
            style: textStyle copy
            from: self startingIndex
            in: self container.
        (paragraph isKindOf: TextOnCurve)
        ifTrue:[ self removeProperty: #CreatingParagraph.
            ^ paragraph].
        wrapFlag
               ifFalse:
            ["Was given huge container at first... now adjust"
            paragraph adjustRightX].
        paragraph focused: (self currentHand keyboardFocus == self).

        self fit.
    ] ensure: [self removeProperty: #CreatingParagraph].

    ^ paragraph

Cheers,
Karl


On Sun, Dec 30, 2018 at 3:56 PM karl ramberg <karlramberg at gmail.com> wrote:

> Broke between #16520 and update: #18028
>
> Best,
> Karl
>
>
> On Sun, Dec 30, 2018 at 3:20 PM karl ramberg <karlramberg at gmail.com>
> wrote:
>
>> I just tested this in a 2.5 image and it worked :-)
>> I'm not sure when it broke...
>>
>> Best,
>> Karl
>>
>>
>> On Sun, Dec 30, 2018 at 9:36 AM karl ramberg <karlramberg at gmail.com>
>> wrote:
>>
>>>  Hi,
>>> You can pull out a Line from the Graphics category in the ObjectsTool.
>>> Then enable 'drop in' in the Lines menu.
>>> Then pull out Text from the Basic category.
>>> In Texts menu you can then select 'follow owner's curve'
>>>
>>> Unfortunately it it broken. I think because NewParagraph uses another
>>> notion of container than what is expected.
>>>
>>> Best,
>>> Karl
>>>
>>> On Sun, Dec 30, 2018 at 2:06 AM Eliot Miranda <eliot.miranda at gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>>     anyone have any code to display text in a nice font along an arc or
>>>> a spiral?
>>>>
>>>> _,,,^..^,,,_
>>>> best, Eliot
>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20181230/2c1ba140/attachment.html>


More information about the Squeak-dev mailing list