News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Porblem with Terminal font in edit control [!SOLVED!]

Started by Mr.reCoder, September 10, 2012, 03:27:21 AM

Previous topic - Next topic

Mr.reCoder

hi all.

the character 0xDB does not show correctly in edit control when the font is "Terminal" in font size "9".

BR.

code is attached...

TouEnMasm


If the text must be as shown in the image,a black retangle,i have also a black rectangle in the edit when I clic the button.
I have XP  SP3
Fa is a musical note to play with CL

TouEnMasm

#2
The design of the font don't seem very good
Quote
NFOFont LOGFONT <-12,-9,0,0,400,0,0,0,-1,1,2,1,49,"Terminal">

You can create the font with this proc (a tool of mine you can found on the misceallenous project ).
http://masm32.com/board/index.php?topic=648.msg5310#msg5310

Quote
   CreeFont PROTO
   CreeFont PROC
         Local  retour:DWORD
         Local  logfont:LOGFONT

   mov logfont.lfHeight,0FFFFFFF4h
   mov logfont.lfWidth,0h
   mov logfont.lfEscapement,0h
   mov logfont.lfOrientation,0h
   mov logfont.lfWeight,190h
   mov logfont.lfItalic,0h
   mov logfont.lfUnderline,0h
   mov logfont.lfStrikeOut,0h
   mov logfont.lfCharSet,0FFh
   mov logfont.lfOutPrecision,1h
   mov logfont.lfClipPrecision,2h
   mov logfont.lfQuality,1h   ;0 DEFAULT_QUALITY ,1 DRAFT_QUALITY,2 PROOF_QUALITY
   mov logfont.lfPitchAndFamily,31h
   jmp overtext
   NamedFont db "Terminal",0      ;LOGFONT
   overtext:
   invoke lstrcpy,addr logfont.lfFaceName,addr NamedFont
   INVOKE     CreateFontIndirect, addr logfont      ;Modifie    logfont:LOGFONT
   mov     retour, eax   ;retourne Hfonte
   ;invoke SendMessage,Hcontrole,WM_SETFONT,Hfonte,FALSE
   FindeCreeFont:
   mov eax,retour
   ret
CreeFont endp

note char DBh=219     >>> alt 219  "¦" on an edit and a richedit

If it those following char you want,they are only shown by an edit created by
createwindowsex.

Quote
0000003C 54 65 73 74 20      C tText db "Test ->","0",0dah,"0ÚÛÛÛÛÜ",0dch,"<- Test",0
      2D 3E 30 DA 30
      DA DB DB DB DB
      DC DC 3C 2D 20
      54 65 73 74 00
00000055 54 65 73 74 20      C ttText db "Test ->","0ÚÛÛÛÛÜ","<- Test",0
      2D 3E 30 DA DB
      DB DB DB DC 3C
      2D 20 54 65 73
      74 00

Fa is a musical note to play with CL

jj2007

Your code assembles fine with small changes in base.inc:

include   \masm32\include\windows.inc

uselib   MACRO   libname
   include      \masm32\include\libname.inc
   includelib   \masm32\lib\libname.lib
ENDM

When clicking OK, the black rectangle exactly as in the bmp shows up in the editbox.
Win XP SP3...

Can you use that font somewhere else, e.g. Notepad or your editor, and do you have the same problem?

MichaelW

The app in the attachment displays all but the control characters for a specified font. For the terminal font the displayed characters look like the familiar (at least to us old timers) VGA character set and are apparently the same on my Windows 2000 SP4 system and my Windows XP SP3 system. But entering the character codes as Alt+N on the numeric keypad seems to work correctly only for character codes < 128.

For example, the characters 219 to 223 are supposed to be a full character-cell block, a lower half, a left half, a right half, and an upper half, just as they appear in the edit control.
Well Microsoft, here's another nice mess you've gotten us into.

Mr.reCoder

@ ToutEnMasm

i use this tools and your codes but not good result!!!



@MichaelW

i use this tool but see picture please...




BR.

Mr.reCoder

Quote from: jj2007 on September 10, 2012, 06:15:18 AM
Your code assembles fine with small changes in base.inc:

include   \masm32\include\windows.inc

uselib   MACRO   libname
   include      \masm32\include\libname.inc
   includelib   \masm32\lib\libname.lib
ENDM

When clicking OK, the black rectangle exactly as in the bmp shows up in the editbox.
Win XP SP3...

Can you use that font somewhere else, e.g. Notepad or your editor, and do you have the same problem?

No! assembly is working fine! the character 0xDB did not show! it shows like space...

BR.

TouEnMasm


Quote
@ ToutEnMasm

i use this tools and your codes but not good result!!!

As I said upper ,only an edit created by createwindowsex (not a resource and not a dialog box) can give you good result.

Now,this listing (upper post also) show how the caracter you want is printed
in an edit created by createwindowsex
Did you agree with that ?

correct printed 0DBh =Û
Quote
0000003C 54 65 73 74 20      C tText db "Test ->","0",0dah,"0ÚÛÛÛÛÜ",0dch,"<- Test",0
      2D 3E 30 DA 30
      DA DB DB DB DB
      DC DC 3C 2D 20
      54 65 73 74 00
00000055 54 65 73 74 20      C ttText db "Test ->","0ÚÛÛÛÛÜ","<- Test",0
      2D 3E 30 DA DB
      DB DB DB DC 3C
      2D 20 54 65 73
      74 00





Fa is a musical note to play with CL

TouEnMasm


the "prompt>█" (alt 219) is shown in dos mode ,here the normal ascii table works.
Seems you have to made your way between dos,windows(dialog or createwindowsex) ascii shown char.
Perhaps an another char ?
Fa is a musical note to play with CL

qWord

Maybe a problem of the current code page - try it with DialogBoxParamW and unicode strings.
MREAL macros - when you need floating point arithmetic while assembling!

Mr.reCoder


SOLVED! THANK YOU qWord and ToutEnMasm ! I LOVE YOU!!!

I USED CreateWindowExW for creating edit at run time!!!
WORKED VERY WELL!!!

SOURCE CODE ATTACHED FOR ANYONE USING....

qWord

 :biggrin:
(you should get the same result by just using DialogBoxParamW in your first program)
MREAL macros - when you need floating point arithmetic while assembling!

Mr.reCoder

Quote from: qWord on September 11, 2012, 01:28:04 AM
:biggrin:
(you should get the same result by just using DialogBoxParamW in your first program)

only works when using CreateWindowExW for crating edit control!! and using DialogBoxParamW alone did not work! you can test...  :t