About Store Forum Documentation Contact



Post Reply 
[Solved] Font Replace
Author Message
Harry Offline
Member

Post: #1
[Solved] Font Replace
font.replace("ś","s");

What's wrong with this code?

1>d:\forest valley\source\intro.cpp(10) : error C2664: 'EE::Font::replace' : cannot convert parameter 1 from 'const wchar_t [2]' to 'Char'
1> There is no context in which this conversion is possible
(This post was last modified: 02-14-2011 11:21 AM by Harry.)
10-22-2009 06:40 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Font Replace
font.replace(L'ś', L's');
10-22-2009 07:15 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #3
RE: Font Replace
What is the difference between "ś" and 'ś' ?
(This post was last modified: 10-22-2009 07:33 PM by Harry.)
10-22-2009 07:31 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Font Replace
"" always indicates zero/NULL terminated string, which in this case translates to array of 2 characters 's', '\0'

char string[]="s";
is equal to
char string[]={'s','\0'};

's' is only one character
10-22-2009 08:04 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #5
RE: Font Replace
Ok. Thanks. Now I've got small problem, because in some texts i use txds files which are made in Gui Editor. What can I do with this texts and polish letters? font.replace makes nothing.
(This post was last modified: 10-22-2009 08:12 PM by Harry.)
10-22-2009 08:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Font Replace
font.replace does work, I tested it, you need to call it after loading a font (for each font separately)
you can access all fonts from font cache 'Fonts' and FontDefault
10-22-2009 09:29 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #7
RE: Font Replace
Ok. I found a way to fix this. Thanks.
10-23-2009 02:43 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply