OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Antialising for text


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
OmegaDoom
Newbie


Joined: 25 Jun 2018
Posts: 16

PostPosted: Tue Jun 26, 2018 8:06 am    Post subject:
Antialising for text
Reply with quote

Hi.
I tried to set sampling traits->samples = 4 but I don't see any improvement.

I use text this way:

Code:
osg::ref_ptr<osgText::Text> text = new osgText::Text;
text->setFont(m_font);
text->setAxisAlignment(osgText::Text::SCREEN);
text->setDrawMode(osgText::Text::TEXT);
text->setAlignment(osgText::Text::LEFT_BOTTOM);
text->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
text->setCharacterSize(11.0);


What do I need to do to make font smoother?
Back to top
View user's profile Send private message
SMesserschmidt (Sebastian Messerschmidt)
Forum Moderator


Joined: 10 Sep 2013
Posts: 823

PostPosted: Tue Jun 26, 2018 8:29 am    Post subject:
Antialising for text
Reply with quote

Hi Igor,

you might want to explicitly set the font resolution to get smoother fonts.

text->setFontResolution(128,128);

And make sure you're using an appropriate true type font.
E.g.
text->setFont("/fonts/arial.ttf");


hth,
Sebastian

Quote:
Hi.
I tried to set sampling traits->samples = 4 but I don't see any improvement.

I use text this way:


Code:
osg::ref_ptr<osgText::Text> text = new osgText::Text;
text->setFont(m_font);
text->setAxisAlignment(osgText::Text::SCREEN);
text->setDrawMode(osgText::Text::TEXT);
text->setAlignment(osgText::Text::LEFT_BOTTOM);
text->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
text->setCharacterSize(11.0);




What do I need to do to make font smoother?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74166#74166









------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
OmegaDoom
Newbie


Joined: 25 Jun 2018
Posts: 16

PostPosted: Tue Jun 26, 2018 9:27 pm    Post subject:
Re: Antialising for text
Reply with quote

SMesserschmidt wrote:
Hi Igor,

you might want to explicitly set the font resolution to get smoother fonts.

text->setFontResolution(128,128);

And make sure you're using an appropriate true type font.
E.g.
text->setFont("/fonts/arial.ttf");


hth,
Sebastian


Hi Sebastian.
text->setFontResolution(128,128); doesn't change anything.
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12144

PostPosted: Wed Jun 27, 2018 7:51 am    Post subject:
Antialising for text
Reply with quote

Hi Igor,

Once you pick an appropriate font resolution for the size of the text
on screen it should be appear pretty smooth. If this isn't happening
then we'll need more information about your OSG version, hardware, OS,
a screen shot, whether the osgtext example renders decent text.

Cheers,
Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Compute line numbers for Glyphs in Te... Ferran Pallarès General 2 Wed Oct 24, 2018 5:58 pm View latest post
No new posts strange behaviour with osgText::Text christoph General 0 Wed Jul 18, 2018 12:06 pm View latest post
No new posts massive text rendering OmegaDoom General 3 Mon Jul 09, 2018 12:14 pm View latest post
No new posts Why is osgText::Text very slow when i... OmegaDoom General 1 Wed Jul 04, 2018 5:31 am View latest post
No new posts setAxisAlignment(osgText::Text::SCREE... OmegaDoom General 1 Tue Jun 26, 2018 9:40 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP