Author Topic: Porblem with Terminal font in edit control [!SOLVED!]  (Read 5719 times)

Mr.reCoder

  • Guest
Porblem with Terminal font in edit control [!SOLVED!]
« on: September 10, 2012, 03:27:21 AM »
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...
« Last Edit: September 11, 2012, 01:43:33 AM by Mr.reCoder »

ToutEnMasm

  • Member
  • *****
  • Posts: 1190
    • EditMasm
Re: Porblem with Terminal font in edit control
« Reply #1 on: September 10, 2012, 03:31:25 AM »

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

ToutEnMasm

  • Member
  • *****
  • Posts: 1190
    • EditMasm
Re: Porblem with Terminal font in edit control
« Reply #2 on: September 10, 2012, 03:41:55 AM »
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

« Last Edit: September 10, 2012, 05:32:01 AM by ToutEnMasm »
Fa is a musical note to play with CL

jj2007

  • Member
  • *****
  • Posts: 9401
  • Assembler is fun ;-)
    • MasmBasic
Re: Porblem with Terminal font in edit control
« Reply #3 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?

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: Porblem with Terminal font in edit control
« Reply #4 on: September 10, 2012, 08:28:24 AM »
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

  • Guest
Re: Porblem with Terminal font in edit control
« Reply #5 on: September 10, 2012, 09:37:33 PM »
@ ToutEnMasm

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



@MichaelW

i use this tool but see picture please...




BR.

Mr.reCoder

  • Guest
Re: Porblem with Terminal font in edit control
« Reply #6 on: September 10, 2012, 09:42:05 PM »
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.

ToutEnMasm

  • Member
  • *****
  • Posts: 1190
    • EditMasm
Re: Porblem with Terminal font in edit control
« Reply #7 on: September 10, 2012, 10:24:22 PM »

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

ToutEnMasm

  • Member
  • *****
  • Posts: 1190
    • EditMasm
Re: Porblem with Terminal font in edit control
« Reply #8 on: September 10, 2012, 10:50:48 PM »

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

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: Porblem with Terminal font in edit control
« Reply #9 on: September 11, 2012, 01:05:01 AM »
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

  • Guest
Re: Porblem with Terminal font in edit control
« Reply #10 on: September 11, 2012, 01:09:49 AM »

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

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: Porblem with Terminal font in edit control
« Reply #11 on: September 11, 2012, 01:28:04 AM »
 :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

  • Guest
Re: Porblem with Terminal font in edit control
« Reply #12 on: September 11, 2012, 01:38:08 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