RE: VW 7.5 text view/editor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: VW 7.5 text view/editor

Steven Kelly
> -----Original Message-----
> From: Mike Bielser [mailto:[hidden email]]
> I have a simple question: Is it possible to have different
> fonts (with different attributes) in one
> and the same text view/editor?

Definitely! You want your Text to have emphases that change the font
family. See CharacterAttributes class>>basicAttributesFor: and
htmlAttributesFor: for some existing ones. E.g. ('Arial' asText
emphasizeAllWith: #family->'Arial'), ('Times' asText emphasizeAllWith:
#family->'Times New Roman')

The one thing you can't do easily is change the line height within a
text view. You'd need to implement your own editor that allowed a
collection of ComposedTexts for that.

HTH,
Steve

Reply | Threaded
Open this post in threaded view
|

Re: VW 7.5 text view/editor

Joachim Geidel
There is a goodie called "ComposedTextEditor" in the contributed/Heeg directory of the VisualWorks distribution. It might be a good starting point/example.

HTH,
Joachim Geidel

Steven Kelly schrieb:

> -----Original Message-----
> From: Mike Bielser [mailto:[hidden email]]
> I have a simple question: Is it possible to have different
> fonts (with different attributes) in one
> and the same text view/editor?

Definitely! You want your Text to have emphases that change the font
family. See CharacterAttributes class>>basicAttributesFor: and
htmlAttributesFor: for some existing ones. E.g. ('Arial' asText
emphasizeAllWith: #family->'Arial'), ('Times' asText emphasizeAllWith:
#family->'Times New Roman')

The one thing you can't do easily is chan! ge the line height within a
text view. You'd need to implement your own editor that allowed a
collection of ComposedTexts for that.

HTH,
Steve
Reply | Threaded
Open this post in threaded view
|

Re: VW 7.5 text view/editor

Mike Bielser
Dear Steven,
Dear Joachim,

thanks a lot for your help and pointers. As to the line height, I can't
really tell yet whether that restriction will bite me later on; I hope not.
Maybe a first approach might be to set the line height according to the
highest font & size combination used?

Thanks again
Mike

Reply | Threaded
Open this post in threaded view
|

RE: VW 7.5 text view/editor

Mark Roberts
In reply to this post by Steven Kelly
At 01:37 AM 1/24/2008, Steven Kelly wrote:
>The one thing you can't do easily is change the line height within a
>text view. You'd need to implement your own editor that allowed a
>collection of ComposedTexts for that.

Has anybody written such a thing? That would be useful for a number
of other purposes, as well.

M