Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » change font from mydsl
change font from mydsl [message #801425] Sat, 18 February 2012 11:02 Go to next message
Phil R is currently offline Phil RFriend
Messages: 99
Registered: September 2011
Member
Hi,

I have a custom font that I would like to set default instead of manually setting the font

it should be set like this configuration:
http://i834.photobucket.com/albums/zz270/fortuda/font.png

However is there a way to use a font object instead of installing the font?
And where to set the font object in xtext to be used as default?

Regards,
Phil
Re: change font from mydsl [message #801612 is a reply to message #801425] Sat, 18 February 2012 17:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
Hi,

Installing / delivering the custom font is not Xtext Specific. So you may find a better answer in an RCP Forum or in the Eclipse Help
Never the less the For the Xtext Editor uses can be configured through the IHighlightingConfiguration

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: change font from mydsl [message #801617 is a reply to message #801612] Sat, 18 February 2012 17:45 Go to previous messageGo to next message
Phil R is currently offline Phil RFriend
Messages: 99
Registered: September 2011
Member
I know that default eclipse plugin development uses an extension for themes and set font definition with xml,
it should be programmatically to avoid the requirement to install the font.

I found that xtext has a LanguageRootPreferencePage, could I do anything with it?

[Updated on: Sat, 18 February 2012 17:46]

Report message to a moderator

Re: change font from mydsl [message #801620 is a reply to message #801617] Sat, 18 February 2012 17:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
Hi,

am not sure what you are talking about. for the syntax coloring there is SyntaxColoringPreferencePage
but as i said this is the step after the IHighlightingConfiguration id called

~Christian

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: change font from mydsl [message #801624 is a reply to message #801620] Sat, 18 February 2012 17:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
P.S: maybe org.eclipse.xtext.ui.editor.syntaxcoloring.PreferenceStoreAccessor.populateTextStyle(String, TextStyle, TextStyle)
is another hook too but it is hard to extend it nicely


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: change font from mydsl [message #801627 is a reply to message #801624] Sat, 18 February 2012 18:03 Go to previous messageGo to next message
Phil R is currently offline Phil RFriend
Messages: 99
Registered: September 2011
Member
ok thank you Christian. I'll check it out.

UPDATE: that's what I was looking for, thx again!

Regards,
Phil

[Updated on: Sat, 18 February 2012 18:06]

Report message to a moderator

Re: change font from mydsl [message #801885 is a reply to message #801425] Sun, 19 February 2012 03:44 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-18-02 12:02, Phil R wrote:
> Hi,
> I have a custom font that I would like to set default instead of
> manually setting the font
>
> it should be set like this configuration:
>
>
> However is there a way to use a font object instead of installing the font?
> And where to set the font object in xtext to be used as default?
>

Any font available in the systems font catalog should be possible to
use. (It is that way on my Mac at least, I get to pick from all
available fonts using the native font picker).

The rest is just a matter of configuring the highlighting (to use the
font you want for plain text, and then use that to defined the other
styles).

If you want to change one of the eclipse default themes, you need to
figure out where to preferences are stored and then set them. (This can
be done programatically - but you probably want to let the user have
control over this as it affects all editors for all environments that
base their styles on the default style.

Does that answer your question?
- henrik
Re: change font from mydsl [message #802026 is a reply to message #801885] Sun, 19 February 2012 09:26 Go to previous message
Phil R is currently offline Phil RFriend
Messages: 99
Registered: September 2011
Member
Hi Henrik the problem is solved by using highlightconfiguration (as Christian also pointed out to me).
Anyway thank you for your full explanations! The support is amazing here !

Regards,
Phil
Previous Topic:Problems writing Scope provider for enumeration literals
Next Topic:Exception when testing language
Goto Forum:
  


Current Time: Tue Apr 16 09:19:38 GMT 2024

Powered by FUDForum. Page generated in 0.28232 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top