|
Hi to all,
I am facing a strange problem, i had asked for help in the forum few days before. But due to certain delays i was unable to show the code. Here is the code. My Problem is with hindi fonts.
When i substitute the the LOGFONT.lfHeight with 0(Zero) then everything works fine, But when i change the size of lfHeight to anything greater or lesser than zero, the Hindi fonts is displayed very small. How to solve this issue.
case WM_INITDIALOG:
LOGFONT lf;
HFONT cFont;
HWND target = GetDlgItem(hwnd,IDC_STATIC1);
HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
GetObject(hFont, sizeof(LOGFONT), &lf);
lf.lfHeight = 0;
cFont = CreateFontIndirect(&lf);
SendMessage(target,WM_SETFONT,(WPARAM)cFont,MAKELPARAM(TRUE,0));
SetWindowText(target,_T("C:\\Program Files\\অভিধান: ইংরেজী\\सरकारी &&"));
break;
sorry for posting twice.
Regards,
Vishal
modified on Thursday, June 9, 2011 1:32 PM
|
|
|
|
|
You need to convert the point height of your font into device units with the following formula:
lFont.lfHeight = MulDiv(nFontHeight, GetDeviceCaps(hDC, LOGPIXELSY), 72);
See the MSDN page for CreateFont()[^] for more information.
The best things in life are not things.
|
|
|
|
|
i am using
-MulDiv(iPointSize,GetDeviceCaps(GetDC(target),LOGPIXELSY),72);
Where iPointSize is the size of font;
But, the results are not up-to mark. If i specify the
lFont.lfHeight = 14
then, the text in english font is ok but the text in hindi font seems like the lfHeight is 8 .
But if i specify the
lFont.lfHeight = 0
Whether hindi or bengali or chinese every font is in same height and looks good, but their sizes are big.
I am using default MS Shell Dlg Font.
Regards,
Vishal
|
|
|
|
|
Try the positive value returned by MulDiv() and/or one of the other fonts, if possible one that was designed for Hindi characters.
The best things in life are not things.
|
|
|
|
|
Yes sir, i had tried. Mangal gives positive result for hindi fonts.
And Trebuchet MS for others.
Sir, i have one small doubt. Do we have to distribute these fonts with application or these are system default fonts available on windows.
and (negative) -MulDiv() gives good result instead of (postive) MulDiv() . Is it OK. Please guide.
Regards,
Vishal
|
|
|
|
|
vishalgpt wrote: Please guide.
I'm afraid I don't have the answer to these questions, you will have to investigate the rest for yourself.
The best things in life are not things.
|
|
|
|
|
thanx.
Regards,
Vishal
|
|
|
|
|
From memory, a negative lfHeight means "points" as opposed to pixels, but you'd have to check the definitions on msdn for LOGFONT.
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: From memory, a negative lfHeight means "points" as opposed to pixels
Thanx for the point. I will check the definitions
Regards,
Vishal
|
|
|
|
|
how to get the code of OnLButtonDown and OnMouseMove etc in OnDraw method ?
|
|
|
|
|
What do you mean exactly ?
Could you please give more information about what you are trying to do ?
|
|
|
|
|
iampradeepsharma wrote: how to get the code of OnLButtonDown and OnMouseMove etc
Do you want generate your own OnLButtonDown and OnMouseMove messages or you want to use that methods functionality?
http://www.mono-project.com/Main_Page
|
|
|
|
|
Your questions is not really clear.
You can see the mouse state Using GetKeyState function. You can know the mouse position using GetCursorPos
Check if this helps?[^]
|
|
|
|
|
I use WinInet + MFC to post some form to the web server.
I add the log module, at last found this:
1. call CInternetSession::GetHttpConnection
2. call CInternetSession::OpenURL
3. call CHttpFile::SendRequest
4. call CHttpFile::QueryInfoStatusCode (block)
at the step 4, some computer is ok, but some computer is block here.
when is block , the last error code:12002 ,it means time out.
I search in this web and google, but usually saied that's the WinInet's bug.
What should I do?
//////////////////////////////////////////////
Thanks for your reply !

|
|
|
|
|
I have a CFormView with a large bitmap of a form.
I lay an edit box on top of the form where the user would
type in a value.
The image of the form has a vertical line that separates the
cents from the dollars. The edit box, even though its white
or light shaded, covers or blocks that vertical line of the
form. How can I make the edit box see-through so that you
still see the background of the form in the edit box?
I tried making the edit box transparent or the bitmap transparent
or one transparent and the other not and no combination is
working.
Please any response any one can give me will be greatly appreciated.
Sincerely,
Danielle
|
|
|
|
|
What about two edit boxes, one for dollars and the other for cents? Or, what about adding the vertical line to the edit box?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I thought about that. Two edit boxes just complicates it. You type in a
number 1234 and then tab off to type in the cents. Its faster to just type
in the number as is.
I thought about adding a vertical line to the edit, but have not figured out
a nice, simple, clean way of doing that.
I found a program on the web that looks like it has the feature Im looking
for. Its just a simple edit box and you can see the form in the background
of that edit.
If you know how to draw that line in the edit box, that would be great.
|
|
|
|
|
|
Hi Experts,
I have a problem. I need to do several cleanup jobs , when the system log off. I tried it by using WM_QUERYENDSESSION on Activex Control class. But it is not working. Please help me.
Thanks,
Spk.
|
|
|
|
|
SAKruykov asked you to clarify your original post[^]. I suggest you do that there, instead of starting a new thread here.
|
|
|
|
|
hello Frndz,
I am using oracle database for my application... in which i wanted to check that database was corrupted or not before my application get started ... kindly give me idea about it..
thanks in advanced...
|
|
|
|
|
I am not sure what this has to do with C++; I suggest you move it to the Database forum.
The best things in life are not things.
|
|
|
|
|
Does Oracle expose an API that you can use for this?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I wouldn't think that was generally possible.
It also depends on what "corrupted" means.
And for a small database I wouldn't think the cost (time to implement) wouldn't be worth it for the product and for a large database it would not only take a long time but I wonder what the app is going to do then?
|
|
|
|
|
According to MSDN, using SetProcessDefaultLayout(LAYOUT_RTL) should change the layout to right-to-left. However, it does not change the window caption - the buttons are still on the right.
I have found that using the extended style WS_EX_LAYOUTRTL does move the caption buttons to the left.
Is this how SetProcessDefaultLayout() is supposed to work? Or is there another API that will move the caption buttons to the left?
While WS_EX_LAYOUTRTL does work, it means that each window creation has to be intercepted and this flag added. I was hoping to find some way to do it only once, when an app starts.
Thanks for any suggestions.
|
|
|
|