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 

osgshxtext


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





PostPosted: Mon Oct 08, 2018 3:15 am    Post subject:
osgshxtext
Reply with quote

Hi OSG developers,


OSG is a great library, and I really like it.
I have written a osg Node class which support display text in AutoCAD shape file.
The source code is attached.
I hope some developer can merge it into OSG after extending it to other platform than Windows.
class ShxText's usage is like this:


osg::Geode* geode = new osg::Geode();


ShxText* pText = new ShxText();
pText->setCharacterSize(10);
pText->SetText(L"Hello, 中国");
pText->SetFontFile("txt.shx", "THFont.SHX");//THFont.shx
pText->SetColor(osg::Vec3f(i / 100.f, j / 100.f, 1.f));
pText->build();


//auto pText = new osgText::Text;
//pText->setText(L"Hello, 中国");
//pText->setCharacterSize(10);
//pText->setFont(font);


geode->addDrawable(pText);



Thanks,
Deping Chen

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12145

PostPosted: Mon Oct 08, 2018 7:51 am    Post subject:
osgshxtext
Reply with quote

HI Deping,

This seems like quite a niche feature so not appropriate for the core
OpenSceneGraph. I would recommend create a small project for it on
github then others can pull it down and help develop it further

Cheers,
Robert.
On Mon, 8 Oct 2018 at 04:15, <> wrote:
Quote:

Hi OSG developers,

OSG is a great library, and I really like it.
I have written a osg Node class which support display text in AutoCAD shape file.
The source code is attached.
I hope some developer can merge it into OSG after extending it to other platform than Windows.
class ShxText's usage is like this:

osg::Geode* geode = new osg::Geode();

ShxText* pText = new ShxText();
pText->setCharacterSize(10);
pText->SetText(L"Hello, 中国");
pText->SetFontFile("txt.shx", "THFont.SHX");//THFont.shx
pText->SetColor(osg::Vec3f(i / 100.f, j / 100.f, 1.f));
pText->build();

//auto pText = new osgText::Text;
//pText->setText(L"Hello, 中国");
//pText->setCharacterSize(10);
//pText->setFont(font);

geode->addDrawable(pText);

Thanks,
Deping Chen



------------------
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



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