|
Well, you have put this code extract between 'pre' tags but it is so badly formatted and spaced as to be virtually unreadable. You could start by reformatting such that each statement is on its own source line, and the code is correctly indented.
As I have stated before you need to use the debugger to isolate the point at which the particular character is being rendered, and capture the font that is being used at that point in order to give a clue as to which statement may be at fault.
For example in the statement:
zaf=CreateFont(int(dj*.4/(p1616?1:4)),0,0,0,LF.lfWeight,LF.lfItalic,0,0,1,0,0,0,FF_DONTCARE,font);
what are the values of dj, p1616, and font? Are they as expected by you and if not what values should they contain?
|
|
|
|
|
I have been testing and looking through the program, and this fault only seems to happen with fonts whose names start with a @ character: @Arial Unicode MS, @Batang, etc.
The "set orientation" parameter when I call CreateFont(), is set as the numeric constant 0:
yaf=CreateFont(h,0,0,0,LF.lfWeight,LF.lfItalic,0,0,1,0,0,0,FF_DONTCARE,font); // h = desired font size, font is a string containing the name of the font to be used
|
|
|
|
|
There are actually two issues here:
1. You are displaying Unicode characters in the range 0x2100 to 0x21FF in your sample (linked to in first article), which may or may not be correct.
2. Font names beginning with @ are designed for vertical characters so will be rotated in 'normal' orientation. I admit this information was not easy to discover - but I managed using Google and MSDN.
I was able to verify all of this by a very simple test program without all the convoluted function calls and parameters in your sample code.
modified on Wednesday, September 2, 2009 11:13 AM
|
|
|
|
|
Curiouser and curiouser. My program discussed here: its font selector lists these fonts:
* "@Arial Unicode MS", which shows the affected characters rotated 90deg anticlockwise;
* "Arial Unicode MS", which looks the same but shows the affected characters the right way up.
Are these two distinct fonts, or is there some strange system effect here?
|
|
|
|
|
See my previous (modified) answer.
|
|
|
|
|
|
You may want to have a look at Font Enumerator[^]. It is was posted here within the last day and it seems to handle those fonts correctly.
|
|
|
|
|
Richard MacCutchan wrote: 2. Font names beginning with @ are designed for vertical characters so will be rotated in 'normal' orientation. I admit this information was not easy to discover - but I managed using Google and MSDN.
Excellent find Richard! Can you show me where you found this information? I have checked the TrueType and OpenType specifications but was unable to find a reference to this font naming convention. Is this standard or Microsoft only?
Take my 5,
-David Delaune
|
|
|
|
|
David,
Take a look at KB937018. I have to say that even using Google it was not a simple matter to find this information. It certainly did not show up on the front page of any of the "Everything you want to know about Fonts" pages. I note that the article referred to in the post by Rick York above does contain a passing reference but again does not really explain it. Somebody somewhere must have a reference to the naming rules...or maybe because it is mostly applicable to Asian languages nobody thinks that we Occidentals need to know about it.
|
|
|
|
|
I have an application and it can be executed both through the command prompt and by double clicking the application file (i.e. App.exe).
The problem is that when the application is double clicked the GetCurrentDirectory() method gives a different path and when it is executed through command-prompt it gives a different path and so i can not use the path retrieved, so if i can identify somehow the way it is invoked, i might make a fix for it.
Please HELP...!!
Thanks in advance.
|
|
|
|
|
GetModuleFileName API
it's my pleasure to make friend with you.
|
|
|
|
|
Thanks "zhu_lin" for the quick reply, it works fine now.
|
|
|
|
|
Dharmendra Bhargava wrote: I have an application and it can be executed both through the command prompt and by double clicking the application file (i.e. App.exe)...so if i can identify somehow the way it is invoked, i might make a fix for it.
Add some command-line argument to the one that is double-clicked (in Explorer).
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Which directory do you want? The one where your executable resides or the one from where you launch it (which could be a different directory)?
In case you need the directory where the executable is located you can use GetModuleFileName() as already suggested.
|
|
|
|
|
I have created a Dialog using Visual studio 2003. in that dialog i have couple of control buttons. And those buttons are in tab stop order. In 1st tab stop 1st button is focused, and if i click space bar than it got clicked. So i expect the enter click should work in the same way when the button is focused. Is there any other property need to set to acheive that....
thanks in advance.....
Birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
Look at the BS_DEFPUSHBUTTON style. The button that has this style is what is invoked (clicked) when you hit enter.
onwards and upwards...
|
|
|
|
|
Thanks for the quick reply.
But in VC++ IDE i did not get the button style property, I think i can do some thing like sendmessage() to the pertucular button to chnage style but i dont how to do that that. Do you have any idea?
Thanks in advance....
Birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
In the dialog editor, look for the Default Button checkbox option.
onwards and upwards...
|
|
|
|
|
Hello Experts,
I am writing a client-server application on Windows XP. My Server application varifies if both client and server are on same host by comparing its own host name( obtained using gethostname() API) with what is configured as the client name in a configuration file. This entry in the configuration file is filled with hostname command run in a batch script. Thus in order for both the names for a given host to match - value returned from hostname command and gethostname() API should be same. I know that gethostname() API always return standard host name of the host, but i am not sure about hostname command. My query is - "If the hostname command is run without any option, does it return standard host name of the host?"
- learner_28
|
|
|
|
|
learner_28 wrote: If the hostname command is run without any option, does it return standard host name of the host?
Well it does on my PC!
|
|
|
|
|
|
Hello All:
As you know the 'const' key word just make the Variable const when it be compiled.
Now I wana get a method what can Achieve run-time const.
|
|
|
|
|
First of all, tell us what scenario that you're encountering requires 'run-time const' items? What are you seeing that makes 'compile-time const' unsuitable?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I got this question from a friend,he just gave me such scenario,I think it is Similar as stack/Heap..
|
|
|
|
|
So what is the correlation between "run-time const" and stack/heap?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|