Author Topic: Character codes for SHX text font  (Read 2425 times)

0 Members and 1 Guest are viewing this topic.

csgoh

  • Newt
  • Posts: 176
Character codes for SHX text font
« on: July 12, 2016, 03:25:21 AM »
What are the character codes for the superscript text for eg m2if one is using a shx font file?

Peter2

  • Swamp Rat
  • Posts: 651
Re: Character codes for SHX text font
« Reply #1 on: July 12, 2016, 04:05:09 AM »
I suppose that it depends on the SDHX you are using - some SHX have it (somewhere ..), some have it not.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Character codes for SHX text font
« Reply #2 on: July 12, 2016, 04:14:29 AM »

csgoh

  • Newt
  • Posts: 176
Re: Character codes for SHX text font
« Reply #3 on: July 12, 2016, 09:52:16 AM »
Noted with thanks.
And is there a way to decompile shx back to shp format?

Peter2

  • Swamp Rat
  • Posts: 651
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

csgoh

  • Newt
  • Posts: 176
Re: Character codes for SHX text font
« Reply #5 on: July 23, 2016, 03:11:35 AM »
I manage to decompile my shx to shp using shxconvert trial version. In the shx, I created a  %%200 to represent m2.
My question is why wcmatch returns nil in one text whereas returns T in another text.
The 200 m2 is entered via command "text" using this text "200 %%200" whereas the 100 m2 is entered via lisp.
Both texts are using wingoh.shx font. Why the difference in the contents even though font display is the same?
Code: [Select]
(defun c:tx1 ( / txt b ma?)
 (vl-load-com)
 (setq txt "100 %%200")
 (setq pt? (getpoint "\nSelect point to place text "))
 (command "text" pt?  5 "0" txt)
 (princ)
 (setq b (car (entsel "\Select text ")))
 (setq b (vla-get-textstring (vlax-ename->vla-object b)))
 (setq ma? (wcmatch b "*%%200*"))
 (print ma?)
)

(defun c:tx2 ( / b ma?)
 (setq b (car (entsel "\Select text ")))
 (setq b (vla-get-textstring (vlax-ename->vla-object b)))
 (setq ma? (wcmatch b "*%%200*"))
 (print (strcat "wcmatch " b ))(print ma?)
)

hmspe

  • Bull Frog
  • Posts: 362
Re: Character codes for SHX text font
« Reply #6 on: July 23, 2016, 09:33:00 AM »
When I look ay the entities in your drawing with (entget (car (entsel))) the string value for the 200 entry is (1 . "200 È") while the value for the 100 entry is (1 . "100 %%200").  È has a character code of Alt+200.  When I create new text from the command line by typing the text    100 %%200   I get a string value of (1 . "100 %%200").  Are you sure you entered the "200" string as    200 %%200    ?
"Science is the belief in the ignorance of experts." - Richard Feynman

Peter2

  • Swamp Rat
  • Posts: 651
Re: Character codes for SHX text font
« Reply #7 on: July 23, 2016, 01:09:13 PM »
...In the shx, I created a  %%200 to represent m2....
I strongly recommend to use the codes which are defined (standardized). ² has code "Alt+0178" - you can check it with the Windows software "Character Map" or with http://www.unicode.org/standard/where/.

If you mess up the codes you will have bad troubles if you (or some else)
- change the textstyle to another font or
- want to enter ² with standard keys or
- want to search for 0178 but you used 0200 or
- ....

Peter
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

hermanm

  • Guest
Re: Character codes for SHX text font
« Reply #8 on: July 23, 2016, 10:47:08 PM »
An alternative is to use MTEXT.
This yields a superscript:
\A1;E = mc{\H0.75x;\S2;}
This produces a subscript:
\A1;b{\H0.75x;\S^f;} = 8"

The fraction following H governs the relative height of the sub or super script.
\A1; centers the 'scripts on the main text.

The advantage of using MTEXT is that it is typeface independent, and therefore requires no special shx files.

csgoh

  • Newt
  • Posts: 176
Re: Character codes for SHX text font
« Reply #9 on: July 24, 2016, 04:26:03 AM »
Are you sure you entered the "200" string as    200 %%200    ?
Yes. Im using acad13.
Thanks Peter for the info. on characters code