[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4697: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4699: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4700: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4701: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
indielib.com • View topic - TTF FONT problem

indielib.com

IndieLib Forum
It is currently Thu Feb 25, 2021 10:34 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: TTF FONT problem
PostPosted: Mon Jun 25, 2012 10:12 pm 
Offline

Joined: Wed Oct 26, 2011 8:57 pm
Posts: 47
Ok...Slower...

I cant draw ttf font's...
I try everything but nope...
Truth is. Yes I can but all is BEHIND background...
That is my best.
And that( draw behind all) I can without Indie TTF.. I was use pure SDL.

PROBLEM
I Can't compile indie ttf fonts 'cose all setting are for unicode.
I have all in Multi-Byte...
I am NOT genye for C++ so I don't know how to convert all so I can use LPCSTR for all strings...
Remember, I make port for GameMaker, so I have some limitation.

Also I can't understand command DrawText. Is that Microsoft command?
That command make BIG problem to me. I can use DrawTextA not 'w' as is in IndieFonts...
Example:
const std::string& strname, const std::string& strpath <--This I can use..
DrawText( const std::wstring& s, <--- This I can't
DrawTextEx( const std::wstring& sText, <--- This I can't
BuildStringCache(const std::wstring& str); <--- This I can't
Generaly wstring make problem.

DrawText<-- When I start "go to definition" MVC2008 open" WinUser.h where is defined DrawText A
So... command " DrawTextEx( const std::wstring& sText," I can use only in combination with LPCSTR... How to do that?

Best regrds
me :)

_________________
zmmaj


Top
 Profile  
 
 Post subject: Re: TTF FONT problem
PostPosted: Tue Jun 26, 2012 7:03 am 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
Well I begin to understand your problem :)

I can't say too much, one thing I would suggest is converting between std::string to std::wstring. Googling should give some help. I never did that though.

As a workaround, you mentioned you can draw using SDL, but everything is drawn in the background (behind everything). Most probably these things can happen:
1. You draw text before anything else
2. SDL calls are always being rendered before everything else

If you have the case 1), just postpone text drawing to the end, so it will always be on top.

Another workaround, if you post the code to render SDL text, I could indicate you where you can override/modify Indielib to draw text using SDL instead.


Top
 Profile  
 
 Post subject: Re: TTF FONT problem
PostPosted: Tue Jun 26, 2012 7:24 am 
Offline

Joined: Wed Oct 26, 2011 8:57 pm
Posts: 47

_________________
zmmaj


Top
 Profile  
 
 Post subject: Re: TTF FONT problem
PostPosted: Wed Jun 27, 2012 8:03 am 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
Let me try later on today something and I'll come back to you.

Just as a reminder, why exactly you can't use normal font entities from Indielib? That I didn't understand totally.


Top
 Profile  
 
 Post subject: Re: TTF FONT problem
PostPosted: Wed Jun 27, 2012 8:46 am 
Offline

Joined: Wed Oct 26, 2011 8:57 pm
Posts: 47
Oh I can use normal Fonts...
I provide example from GM forum.. I think there is and exe as well :(
I can't implement TTF fonts...

You see... author of TTF fonts was use DrawText command who is Microsoft command...
I invoke in my dll several windows component's, so when I click to TTF Fonts command
"DrawText" MVC was gone to WinUser.h definition ... I think that is wrong...
I need diferent and unique command for this... maybe just drawtext or similar...
That command need to use std::string or LPCSTR as input argument.

And I was try that, but just I say, I am not expert for c++, and I am failure...
That is reason Why I need help... I am stuck here, for several days...
:(((

_________________
zmmaj


Top
 Profile  
 
 Post subject: Re: TTF FONT problem
PostPosted: Wed Jun 27, 2012 10:09 am 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
IND_Entity2d supports IND_Fonts, and you set the text via a char*, which is the same as an std::string, you just need to call the c_str() method on it to get the char*.

Are you sure this tutorial: , doesn't work for you in your GM integration?

You just need to create a font using MudgeFont, and have the generated resources added to the resources directory you may be using.


Top
 Profile  
 
 Post subject: Re: TTF FONT problem
PostPosted: Wed Jun 27, 2012 11:47 am 
Offline

Joined: Wed Oct 26, 2011 8:57 pm
Posts: 47
IND_Font Work...
But IND_Font use png picture as font input.
I can't implement TTF_font... THAT is a problem
I am not making a game, I make a PORT for idie lib, so loading ttf fonts is just one more option for dll.
Idea is to implement loading and TTF fonts as one option.

So... Again:)
Yes I can load Mudge fonts... I haven't problem for png fonts
I have problem with TTF fonts. OK?

I was found THIS
viewtopic.php?f=13&t=174
So I was try to implement in my dll that, but I can't cose all there was made for UNICODE
I don't use UNICODE compiling, so, I need help in that...
I was wrote to author ( personal message) but nothing I got for days.
So, if you, or someone else can to translate IND_TTF_Font from Unicode to Multi-Byte, that will be just great, and all work was finished.
Also, if you make translation, please change DrawText, and DrawTextEx command to something else ( eg. PrintText and PrintTextEx) if is possible

That is ONE way how you can help.... Or Another....
Help me, to draw text with pure SDL.. I was provide all used code for that in previous post.


Thank you.

_________________
zmmaj


Top
 Profile  
 
 Post subject: Re: TTF FONT problem
PostPosted: Wed Jun 27, 2012 12:28 pm 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
IND_TTF_Font is not officially included in Indielib, so you don't really need to support it.. it was a user supplied class to add TTF font support for Indielib...

I'm not familiar with IND_TTF_Font but I'll give it a shot later on. Don't promise anything though. :(


Top
 Profile  
 
 Post subject: Re: TTF FONT problem
PostPosted: Thu Jun 28, 2012 7:58 am 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
I could not spend time on your issue yesterday :(

But I found this


Is it useful?


Top
 Profile  
 
 Post subject: Re: TTF FONT problem
PostPosted: Thu Jun 28, 2012 8:51 am 
Offline

Joined: Wed Oct 26, 2011 8:57 pm
Posts: 47
I will still have problem with used DrawText and drawTextEx command
Both are WinUser.h commands, and i don't know how to solve that...
Simple renamig don't work :(

However, thank you for your time :(

Example for newest you can see here
http://www.zmajsoft.com/GAMES/Test Sr-Bin Game.rar
with indie lib fonts....

I was see yesterday, that I have problem to load small font from your example...
wont work...
big font work correctly.

_________________
zmmaj


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group