Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting gibberish font when openning old autocad r12 DWG file

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
lioritshiran
1350 Views, 6 Replies

Getting gibberish font when openning old autocad r12 DWG file

Hi all,

I got an old Autocad R12 file and the font is gibberish.

 

How can I solve this problem??

 

thanks.

Tags (1)
6 REPLIES 6
Message 2 of 7
Kent1Cooper
in reply to: lioritshiran


@lioritshiran wrote:

....

I got an old Autocad R12 file and the font is gibberish.

 

How can I solve this problem??

....


The "right" solution would be to get the .SHX file for the font.  [I don't recall whether .TTF fonts were usable yet in R12 -- I'm assuming .SHX is appropriate.]  If that's not possible....

It could be [in fact, I would guess it's likely] that the non-gibberish content is embedded in there.  We used to have some fonts from a company called LETTEREASE that were .SHX files of nicer-looking characters than any of AutoCAD's native .SHX fonts, with an overlay program that would do things like kerning and variable spacing.  It used "characters" defined in the font files that had no drawn content but that only adjusted the pen position between letters forward or back by various small distances, to fine-tune the spacing, based on the particular characters adjacent at that point [for some combinations it wouldn't add any spacing character].  Those spacing-adjustment characters now look like gibberish among the real characters when we open old drawings that used that system.  Here's the text-content entry from the entity data for a line on a Cover Sheet that says "HOUSING FOR THE ELDERLY":

 

(1 . "H%%205O%%203U%%203SIN%%205G F%%207O%%204R T%%203HE EL%%204D%%202ERL%%225Y")

 

The %%-followed-by-a-3-digit-number parts are the special spacing characters, which look like assorted kinds of gibberish in the drawing [mostly various letters with umlauts and accents, but also some other things].

 

If your problem comes from something like that, a routine could certainly be built that would take the text content and remove any [in the case of this particular source of gibberishness] sequence of two percent signs and three numerical digits.  If you do that to the above, you end up with the correct plain wording.  To see the nature of the gibberish, do

 

(entget (car (entsel "\Select Text: ")))

 

, pick a piece of Text, and look for the (1 . "This is the text content.") entry in the returned entity data list.  Post that, and maybe someone will be able to work out the code to "fix" it.

Kent Cooper, AIA
Message 3 of 7
Kent1Cooper
in reply to: Kent1Cooper


@Kent1Cooper wrote:
.... 

If your problem comes from something like that, a routine could certainly be built that would take the text content and remove any [in the case of this particular source of gibberishness] sequence of two percent signs and three numerical digits.  ....


In that particular case, this seems to do it:

 

(setq content (cdr (assoc 1 (entget (car (entsel "\nSelect Text to un-gibberish-ify: "))))))
(while
  (wcmatch content "*%%###*")
  (setq content
    (vl-string-subst "" (substr content (1+ (vl-string-search "%%" content)) 5) content)
  )
)

 

That's in simplest terms, and so far it only returns the fixed content without applying it to the selected Text, and it doesn't yet account for the possibility of other %% codes [such as for underlining, overscoring, diameter/degree/plus-minus symbols] that might occur before the first special-spacing code at some step(s) in that (while) loop, but those things could be added in if that kind of solution would work for you.

Kent Cooper, AIA
Message 4 of 7
Kent1Cooper
in reply to: Kent1Cooper


Kent1Cooper wrote:

... That's in simplest terms, and so far it only returns the fixed content without applying it to the selected Text, and it doesn't yet account for the possibility of other %% codes [such as for underlining, overscoring, diameter/degree/plus-minus symbols] that might occur before the first special-spacing code at some step(s) in that (while) loop, but those things could be added in if that kind of solution would work for you.


For anyone who has old LetterEase Text entities with this condition, here's a routine that accounts for the above and takes out the gibberish.  It should also work on gibberish arising from other sources if the gibberish is added characters in the %%-followed-by-3-digits form.

 

;;  UnKernLE.lsp [command name: UNKERN]
;;  To remove special-spacing characters from old LetterEase
;;    system kerned or closer/wider-spaced Text entities.
;;  WATCH RESULTS for the possibility of removal of other special characters that may
;;    be defined by %% followed by 3 digits, but that are not LE special-spacing characters.
;;  Kent Cooper, 11 November 2014

(defun C:UnKern (/ tsel tdata tcontent start 5char)
  (if (setq tsel (entsel "\nSelect kerned/spaced LetterEase Text to remove gibberish: "))
    (progn ; then
      (setq
        tdata (entget (car tsel))
        tcontent (cdr (assoc 1 tdata))
        start 0; initial starting position for (vl-string-search) function
      ); setq
      (while
        (wcmatch tcontent "*%%###*")
          ;; contains %% followed by any 3-digit number [special spacing characters]
        (setq 5char (substr tcontent (1+ (vl-string-search "%%" tcontent start)) 5))
          ;; first 5 characters starting with %%
        (if (wcmatch 5char "%%###")
          ;; first %% is followed by 3-digit number [not e.g. P, C, D, O, U, or only 1 or 2 digits]
          (setq tcontent (vl-string-subst "" 5char tcontent)); then -- remove
          (setq start (+ 2 (vl-string-search "%%" tcontent start))); else -- move start point forward
        ); if
      ); while
      (entmod (subst (cons 1 tcontent) (assoc 1 tdata) tdata)); replace with gibberish removed
    ); progn
  ); if
  (princ)
); defun

(vl-load-com)
(prompt "\nType UnKern to remove gibberish from LetterEase specially-spaced Text.")

Kent Cooper, AIA
Message 5 of 7
Moshe-A
in reply to: lioritshiran

Lior Shalom,

 

Post the file in R12 format (do not save it in newer AutoCAD format)

 

Moshe

 

Message 6 of 7
lioritshiran
in reply to: Moshe-A


@Moshe-A wrote:

Lior Shalom,

 

Post the file in R12 format (do not save it in newer AutoCAD format)

 

Moshe

 


Hi Moshe,

Thank you, but I've managed using old R12 fonts.

Message 7 of 7
Moshe-A
in reply to: lioritshiran

then mark this thread as solved

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost