Author Topic: Fonts for grvecs  (Read 11678 times)

0 Members and 1 Guest are viewing this topic.

reltro

  • Guest
Fonts for grvecs
« on: May 03, 2014, 02:32:39 PM »
Hey People...
Short time ago I wrote a python-script to extract information out of a .pt3 (Font) to generate a lisp-function wich calculates the vertices of a text for the use with grvecs...

curves in the original font are ignored.

Wanna share some Fonts, and if somebody wants, the python-script...

greets
reltro
« Last Edit: May 03, 2014, 02:43:52 PM by reltro »

NICK_VNV

  • Newt
  • Posts: 63
Re: Fonts for grvecs
« Reply #1 on: May 03, 2014, 03:17:48 PM »
It's interesting,  I would like to see the python script too  :-D
Sorry for my English...

reltro

  • Guest
Re: Fonts for grvecs
« Reply #2 on: May 04, 2014, 09:05:05 AM »
@NICK_VNV: sent it as PM

Greets
reltro

NICK_VNV

  • Newt
  • Posts: 63
Re: Fonts for grvecs
« Reply #3 on: May 04, 2014, 01:25:18 PM »
Thanks! It works fine  :-)
But i can't find the way for covert my font to *.pt3 format which contains not only english letters? (I want to use other languages too) Maybe somebody know?
Sorry for my English...

Inciner

  • Guest
Re: Fonts for grvecs
« Reply #4 on: May 08, 2014, 05:43:24 PM »
Excellent! Can I get python code too?

Inciner

  • Guest
Re: Fonts for grvecs
« Reply #5 on: May 08, 2014, 06:54:34 PM »
I also love solution, provided by Lee Mac at his Grtext lisp demo.
http://lee-mac.com/grtext.html
It's very flexible on my mind.

reltro

  • Guest
Re: Fonts for grvecs
« Reply #6 on: May 09, 2014, 06:02:02 AM »
@Inciner:
Python-script as PM

Oh, thats nice... I used LeeMac's Grtext too, but I never got the Point how the Chars are calculated; nice method... :)
But in use the displayed text wasn't very good to read, so I decided to go for an other approach...

@NICK_VNV:
I never used a not englisch/latin Font because I don't need them... So, I can't help.
Beside, there is much more information in the .pt3 than the python-script extract.
If u find a way to use non-latin chars/fonts let us know how to do...

Greets reltro

Inciner

  • Guest
Re: Fonts for grvecs
« Reply #7 on: May 09, 2014, 10:41:44 AM »
I was drawing cyrillic symbols for Lee Mac's solution right in Libre Office whole yesterday.
Thank you for script! =)

ymg

  • Guest
Re: Fonts for grvecs
« Reply #8 on: May 09, 2014, 03:49:35 PM »
If you entmakex your text there is no need
for transforming fonts.

Code: [Select]
(defun c:test (/ etxt p prvtext scl str txt txtp xog yof)
   (setq  xof 30
    yof -30
          scl (/ (getvar 'viewsize) (cadr (getvar 'screensize)))
   )
   (while (= 5 (car (setq p (grread nil 13 0))))
      (setq    p (cadr p)
     str (mapcar 'rtos p)
    txtp (list (+ (car  p) (* xof scl)) (+ (cadr p) (* yof scl)))
     txt (strcat  "X= " (car str) "\\PY= " (cadr str))
      )
      (setq etxt (list (cons 0 "MTEXT")
       (cons 100 "AcDbEntity")
       (cons 62 2)
       (cons 100 "AcDbMText")
       (cons 10 txtp)
       (cons 40 (* 15 scl))
       (cons 1 txt)
  )
      )
      (if prvtext (entdel prvtext))
      (setq prvtext  (entmakex etxt))
   )
   (entdel prvtext)
)
« Last Edit: May 09, 2014, 03:56:31 PM by ymg »

reltro

  • Guest
Re: Fonts for grvecs
« Reply #9 on: May 10, 2014, 07:49:17 AM »
Hey ymg...

it is a nice approach...
but, in this case u need also an *error*-handler, or better a vl-catch-all-apply... If not, the mtext will be there if the user hits ESC for Example; but I'm sure u knew this ;)

I prefer the grvecs-method to avoid something like this.
Also, if I need to draw a lot of stuff I prefer the grvecs-method... Put all together in a list and draw it ;)

Greets
« Last Edit: May 10, 2014, 09:27:42 AM by reltro »

ymg

  • Guest
Re: Fonts for grvecs
« Reply #10 on: May 10, 2014, 08:45:38 AM »
reltro,

If you want to catch Escape Key, here is the modified code:

Code: [Select]
(defun c:test (/ etxt p prvtext scl str txt txtp xog yof)
 
   ; Error Handler by ElpanovEvgenyi  ;
   (defun *error* (msg)
(mapcar 'eval varl)
(if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")))
           (princ (strcat "\nError: " msg))
        )
        (if prvtext (entdel prvtext))
(and *AcadDoc* (vla-endundomark *AcadDoc*))
        (princ)
    )
     
    (setq varl '("CLAYER" "OSMODE" "CMDECHO" "DIMZIN")
          varl (mapcar (function (lambda (a) (list 'setvar a (getvar a)))) varl)
    )

    (setq xof 30
          yof -30
          scl (/ (getvar 'viewsize) (cadr (getvar 'screensize)))
    )
    (while (= 5 (car (setq p (grread nil 13 0))))
       (setq    p (cadr p)
      str (mapcar 'rtos p)
     txtp (list (+ (car  p) (* xof scl)) (+ (cadr p) (* yof scl)))
      txt (strcat  "X= " (car str) "\\PY= " (cadr str))
       )
       (setq etxt (list (cons 0 "MTEXT")
        (cons 100 "AcDbEntity")
        (cons 62 2)
        (cons 100 "AcDbMText")
        (cons 10 txtp)
        (cons 40 (* 15 scl))
        (cons 1 txt)
   )
       )
       (if prvtext (entdel prvtext))
       (setq prvtext  (entmakex etxt))
    )
    (entdel prvtext)
    (*error* nil)
)

reltro

  • Guest
Re: Fonts for grvecs
« Reply #11 on: May 10, 2014, 01:28:39 PM »
whats about this? ;)
Code: [Select]
(vl-catch-all-apply '(lambda (/) (C:test)))
and then pressing Escape? ;)
(sry, just trolling a lil bit)

Greets

ymg

  • Guest
Re: Fonts for grvecs
« Reply #12 on: May 10, 2014, 01:33:54 PM »
Would rather use an error handler.

The vl-catch-all-apply will not reset your sysvars or your layer.

ymg

reltro

  • Guest
Re: Fonts for grvecs
« Reply #13 on: May 10, 2014, 02:31:15 PM »
whats about a combination of *error*-handler and vl-catch-all-apply?

Code: [Select]
(defun c:test (/ etxt p prvtext scl str txt txtp xog yof ini*error* catch)
 
    (defun ini*error* (name sysvars / *doc*)
        (vla-startundomark (setq *doc* (vla-get-activedocument (vlax-get-acad-object))))
        (eval
            (list 'defun '*error* '(msg / )
                (list
                    (lambda (name prevErrorHandler SysVars *doc* currentcmdecho / )
                        (mapcar
                            'setvar
                            (mapcar 'car SysVars)
                            (mapcar 'cdr SysVars)
                        )
                        (vla-endundomark *doc*)
                        (setq *error* prevErrorHandler)
                        (if msg
                            (progn
                                (setvar 'cmdecho 0)
                                (command-s "_.undo" 1 "")
                                (setvar 'cmdecho currentcmdecho)
                               
                                (princ "\n*** error ***\n")
                                (princ (strcat "\t" name ": " (vl-princ-to-string msg) "\n"))
                               
                                (*error* msg)
                                (princ)
                            )
                        )
                    )
                    (vl-princ-to-string name)
                    *error*
                    (list 'quote
                        (mapcar
                            '(lambda (a / ) (cons a (getvar a)))
                            sysvars
                        )
                    )
                    *doc*
                    (getvar 'cmdecho)
                )
            )
        )
    )
   
    (ini*error*
        "Grread with MTEXT - ymg"
        '("CLAYER" "OSMODE" "CMDECHO" "DIMZIN")
    )
   
    (setvar 'osmode 0)
    (setq catch
        (vl-catch-all-apply
            '(lambda ( / )
                (setq xof 30
                      yof -30
                      scl (/ (getvar 'viewsize) (cadr (getvar 'screensize)))
                )
               
                (while (= 5 (car (setq p (grread nil 13 0))))
                   (setq    p (cadr p)
                      str (mapcar 'rtos p)
                     txtp (list (+ (car  p) (* xof scl)) (+ (cadr p) (* yof scl)))
                      txt (strcat  "X= " (car str) "\\PY= " (cadr str))
                   )
                   (setq etxt (list (cons 0 "MTEXT")
                            (cons 100 "AcDbEntity")
                            (cons 62 2)
                            (cons 100 "AcDbMText")
                            (cons 10 txtp)
                            (cons 40 (* 15 scl))             
                            (cons 1 txt)
                       )
                   )
                   (if prvtext (entdel prvtext))
                   (setq prvtext  (entmakex etxt))
                )
            )
        )
    )
    (entdel prvtext)
    (if (vl-catch-all-error-p catch)
        (progn
            (*error* (vl-catch-all-error-message catch))
            catch
        )
        (*error* nil)
    )
)

I'm not sure if this is good practice...

reltro
« Last Edit: May 10, 2014, 03:03:13 PM by reltro »

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Fonts for grvecs
« Reply #14 on: May 10, 2014, 11:43:21 PM »
whats about a combination of *error*-handler and vl-catch-all-apply?

Code: [Select]
(defun c:test (/ etxt p prvtext scl str txt txtp xog yof ini*error* catch)
 
    (defun ini*error* (name sysvars / *doc*)
        (vla-startundomark (setq *doc* (vla-get-activedocument (vlax-get-acad-object))))
        (eval
            (list 'defun '*error* '(msg / )
                (list
                    (lambda (name prevErrorHandler SysVars *doc* currentcmdecho / )
                        (mapcar
                            'setvar
                            (mapcar 'car SysVars)
                            (mapcar 'cdr SysVars)
                        )
                        (vla-endundomark *doc*)
                        (setq *error* prevErrorHandler)
                        (if msg
                            (progn
                                (setvar 'cmdecho 0)
                                (command-s "_.undo" 1 "")
                                (setvar 'cmdecho currentcmdecho)
                               
                                (princ "\n*** error ***\n")
                                (princ (strcat "\t" name ": " (vl-princ-to-string msg) "\n"))
                               
                                (*error* msg)
                                (princ)
                            )
                        )
                    )
                    (vl-princ-to-string name)
                    *error*
                    (list 'quote
                        (mapcar
                            '(lambda (a / ) (cons a (getvar a)))
                            sysvars
                        )
                    )
                    *doc*
                    (getvar 'cmdecho)
                )
            )
        )
    )
   
    (ini*error*
        "Grread with MTEXT - ymg"
        '("CLAYER" "OSMODE" "CMDECHO" "DIMZIN")
    )
   
    (setvar 'osmode 0)
    (setq catch
        (vl-catch-all-apply
            '(lambda ( / )
                (setq xof 30
                      yof -30
                      scl (/ (getvar 'viewsize) (cadr (getvar 'screensize)))
                )
               
                (while (= 5 (car (setq p (grread nil 13 0))))
                   (setq    p (cadr p)
                      str (mapcar 'rtos p)
                     txtp (list (+ (car  p) (* xof scl)) (+ (cadr p) (* yof scl)))
                      txt (strcat  "X= " (car str) "\\PY= " (cadr str))
                   )
                   (setq etxt (list (cons 0 "MTEXT")
                            (cons 100 "AcDbEntity")
                            (cons 62 2)
                            (cons 100 "AcDbMText")
                            (cons 10 txtp)
                            (cons 40 (* 15 scl))             
                            (cons 1 txt)
                       )
                   )
                   (if prvtext (entdel prvtext))
                   (setq prvtext  (entmakex etxt))
                )
            )
        )
    )
    (entdel prvtext)
    (if (vl-catch-all-error-p catch)
        (progn
            (*error* (vl-catch-all-error-message catch))
            catch
        )
        (*error* nil)
    )
)

I'm not sure if this is good practice...

reltro

I did this several years ago, but it may be of interest: http://www.theswamp.org/index.php?topic=30660.0
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Fonts for grvecs
« Reply #15 on: May 11, 2014, 09:49:02 AM »
I also love solution, provided by Lee Mac at his Grtext lisp demo.
http://lee-mac.com/grtext.html
It's very flexible on my mind.


Thank you Inciner!  :-)
That is a fantastic way to visualise the vector encoding.

If you entmakex your text there is no need
for transforming fonts.

Similar to Alan's linked example, this is also the method I used in my very old Dynamic Information program; however, I much prefer the far cleaner solution of displaying text using temporary vector graphics, rather than many thousands of additions/deletions/modifications to the drawing database (which may also bloat UNDO cache files).
« Last Edit: May 11, 2014, 09:56:28 AM by Lee Mac »

ymg

  • Guest
Re: Fonts for grvecs
« Reply #16 on: May 11, 2014, 03:12:33 PM »
Bloating the UNDO cache is definitively a possibility.

Can be prevented that turning UNDO Off at beginning of routine
and back on as routine completes.

Creating and Deleting entities as far as I am concerned is a moot point
as it is designed for this exact purpose.  On top of that those grvec vectors
have to live somewhere while you display then.

ymg

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Fonts for grvecs
« Reply #17 on: May 11, 2014, 03:21:35 PM »
On top of that those grvec vectors have to live somewhere while you display then.

Yes, but the overhead will be substantially less.

reltro

  • Guest
Re: Fonts for grvecs
« Reply #18 on: May 12, 2014, 05:07:23 PM »
On top of that those grvec vectors have to live somewhere while you display then.

:) they live somewhere in the wonderland but I have not to be worried about where this place is :)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Fonts for grvecs
« Reply #19 on: May 13, 2014, 10:53:33 AM »
...however, I much prefer the far cleaner solution of displaying text using temporary vector graphics, rather than many thousands of additions/deletions/modifications to the drawing database (which may also bloat UNDO cache files).
I've never thought about this as an issue. Is this something that has always occurred, or just in newer versions? I do notice that, if I've had c3d open all day, doing a lot of heavy work, c3d can become a little laggy, but restarting acad (not computer) will solve the issue.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Fonts for grvecs
« Reply #20 on: May 13, 2014, 02:53:54 PM »
...however, I much prefer the far cleaner solution of displaying text using temporary vector graphics, rather than many thousands of additions/deletions/modifications to the drawing database (which may also bloat UNDO cache files).
I've never thought about this as an issue. Is this something that has always occurred, or just in newer versions? I do notice that, if I've had c3d open all day, doing a lot of heavy work, c3d can become a little laggy, but restarting acad (not computer) will solve the issue.

I can't say whether it has always been the case, but I've certainly seen some pretty large UNDO.ac$ files in the past, with the 'running out of system memory' message not long to follow. I should imagine restarting AutoCAD cleans up the UNDO cache and the application starts afresh on the next run.

ymg

  • Guest
Re: Fonts for grvecs
« Reply #21 on: May 13, 2014, 08:36:46 PM »
AlanJT,

That Undo file certainly grow in the case of such a program
where you keep drawing and erasing to do animation.

However a simple command like
Code: [Select]
(vl-cmdf "_AUTO" "_OFF")
prevents it from growing.

Been like that for as long as I can remember. (And that's a long way!)

ymg

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Fonts for grvecs
« Reply #22 on: May 14, 2014, 01:06:16 AM »
AlanJT,

That Undo file certainly grow in the case of such a program
where you keep drawing and erasing to do animation.

However a simple command like
Code: [Select]
(vl-cmdf "_AUTO" "_OFF")
prevents it from growing.

Been like that for as long as I can remember. (And that's a long way!)

ymg

I assume you mean
Code: [Select]
(vl-cmdf "_UNDO" "_AUTO" "_OFF")
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

ymg

  • Guest
Re: Fonts for grvecs
« Reply #23 on: May 14, 2014, 11:26:49 AM »
Quote
I assume you mean
Code: [Select]
(vl-cmdf "_UNDO" "_AUTO" "_OFF")

Indeed!  :embarrassed:

Sorry! about that.

ymg

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Fonts for grvecs
« Reply #24 on: May 14, 2014, 02:20:09 PM »
Interesting. Is there an adverse effect to turning off auto all the time?

Keep in mind, I've not experienced undo issues, nor do I create/erase objects for animation.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Fonts for grvecs
« Reply #25 on: May 14, 2014, 02:24:47 PM »
Execution speed, especially when batch processing dwgs in the thousands may upset peers that prefer to do things the hard (manual) way.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Fonts for grvecs
« Reply #26 on: May 14, 2014, 02:38:43 PM »
Execution speed, especially when batch processing dwgs in the thousands may upset peers that prefer to do things the hard (manual) way.
Then I should be worried.  :lol:
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Fonts for grvecs
« Reply #27 on: May 14, 2014, 02:44:48 PM »
My favorite setting:

(vl-cmdf "_undo" "_control" "_none")

:evil:
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ymg

  • Guest
Re: Fonts for grvecs
« Reply #28 on: May 14, 2014, 04:04:28 PM »
Quote
Interesting. Is there an adverse effect to turning off auto all the time?

I normally turn it back on on completion of the routine
in the Error Handler, in order to catch the "Escape" artist.

But I certainly like having undo available specially when
testing routines.

ymg

chlh_jd

  • Guest
Re: Fonts for grvecs
« Reply #29 on: May 25, 2014, 08:21:02 AM »
Hey People...
Short time ago I wrote a python-script to extract information out of a .pt3 (Font) to generate a lisp-function wich calculates the vertices of a text for the use with grvecs...

curves in the original font are ignored.

Wanna share some Fonts, and if somebody wants, the python-script...

greets
reltro
Great works !
dose these font-vectors maked by some tools ,which has a function tanslate shape into vectors ?

hanhphuc

  • Newt
  • Posts: 64
Re: Fonts for grvecs
« Reply #30 on: May 25, 2014, 05:20:25 PM »
hi all, here i attempted dxf-modify method in order to justify code 71 .Then i applied a lambda to determine the best quadrant if the text reaches each end corner, so it can be seen (not exceed screen or hidden)
lastly, applied to suit current UCS. thank you
i remarked with double asterisk **
Code: [Select]

;"Grread with MTEXT by ymg"
; version: ymg -> reltro -> alanjt
; http://www.theswamp.org/index.php?action=post;msg=521731;topic=46966.30
; similar reference tread http://www.lee-mac.com/grtext.html

; ** --> partial commented with ** attempted by hanhphuc
(defun c:test (/ etxt p prvtext scl str txt txtp xog yof ini*error* catch
                              vec ); **
 
    (defun ini*error* (name sysvars / *doc*)
        (vla-startundomark (setq *doc* (vla-get-activedocument (vlax-get-acad-object))))
        (eval
            (list 'defun '*error* '(msg / )
                (list
                    (lambda (name prevErrorHandler SysVars *doc* currentcmdecho / )
                        (mapcar
                            'setvar
                            (mapcar 'car SysVars)
                            (mapcar 'cdr SysVars)
                        )
                        (vla-endundomark *doc*)
                        (setq *error* prevErrorHandler)
                        (if msg
                            (progn
                                (setvar 'cmdecho 0)
                                (command-s "_.undo" 1 "")
                                (setvar 'cmdecho currentcmdecho)
                               
                                (princ "\n*** error ***\n")
                                (princ (strcat "\t" name ": " (vl-princ-to-string msg) "\n"))
                               
                                (*error* msg)
                                (princ)
                            )
                        )
                    )
                    (vl-princ-to-string name)
                    *error*
                    (list 'quote
                        (mapcar
                            '(lambda (a / ) (cons a (getvar a)))
                            sysvars
                        )
                    )
                    *doc*
                    (getvar 'cmdecho)
                )
            )
        )
    )
   
    (ini*error*
        "Grread with MTEXT - ymg"
        '("CLAYER" "OSMODE" "CMDECHO" "DIMZIN")
    )
   
    (setvar 'osmode 0)
    (setq catch
        (vl-catch-all-apply
            '(lambda ( / )
       
;|**
              (setq
  xof 30
  yof -30
  scl (/ (getvar 'viewsize) (cadr (getvar 'screensize)))
)|; ;**
   
(while
 
(= 5 (car (setq p (grread nil 13 0))))

(setq Vcp (trans (getvar "viewctr") 1 0)                            ; ** setq vcp
      scl (/ (getvar 'viewsize) (cadr (getvar 'screensize)))
      p   (trans (cadr p) 1 0 t)                             ; ** trans
      vec                             ; ** setq vec
  (mapcar
    '(lambda (x)
       (equal (mapcar '>= p Vcp) x)
     )
    '((T T T) (nil T T) (nil nil T) (T nil T))
  )                                                          ; ** mapcar
)

(cond ((nth 0 vec)
       (setq xof -15
     yof -15
       )
      )
      ((nth 1 vec)
       (setq xof 15
     yof -15
       )
      )
      ((nth 2 vec)
       (setq xof 15
     yof 15
       )
      )
      ((nth 3 vec)
       (setq xof -15
     yof 15
       )
      )
) ; ** cond
 
 
                   (setq
;;; p (cadr p)                               ; ** removed
     
                      str (mapcar 'rtos (trans p 0 1))        ; ** trans UCS

     
                     txtp (list (+ (car  p) (* xof scl)) (+ (cadr p) (* yof scl)))
                      txt (strcat  "X= " (car str) "\\PY= " (cadr str))
                   )

                   (setq etxt (list (cons 0 "MTEXT")
                            (cons 100 "AcDbEntity")
                            (cons 62 2)
                            (cons 100 "AcDbMText")
                            (cons 10 txtp)
                            (cons 40 (* 10 scl)) 
                            (cons 1 txt)
                       )
                   )


;| **
(if prvtext
  (entdel prvtext)
)
|; ;**


(if
prvtext

(mapcar '(lambda (x y) (dxfmod prvtext x y))
        '(10 40 1 62) (list txtp (* 10 scl) txt 2))
 
(setq prvtext (entmakex etxt))

  ) ; ** dxfmod & entmakex


(cond ((nth 0 vec) (dxfmod prvtext 71 3))
      ((nth 1 vec) (dxfmod prvtext 71 1))
      ((nth 2 vec) (dxfmod prvtext 71 7))
      ((nth 3 vec) (dxfmod prvtext 71 9))
) ; ** cond

;;;(setq prvtext (entlast))        ; **


); while
 
(if prvtext (entdel prvtext))

(princ )
 

 
                )
            )
        )
    )

;;;(setq prvtext  (entmakex etxt)); **

    (if (vl-catch-all-error-p catch)
        (progn
            (*error* (vl-catch-all-error-message catch))
            catch
        )
        (*error* nil)
    )


; ** hp#007
(defun dxfmod (_e _i val / lst ) ; (dxfmod entity index new-value )
  (setq lst (entget _e)) ; old dxf list
  (if (assoc _i lst)
    (entmod (subst (cons _i val)
   (assoc _i lst)
   lst
    )
    ) ;subst old to new
    (entmod (append lst (list (cons _i val)))) ; add new to dxf
  ) ; if
  (princ)
); **

« Last Edit: May 25, 2014, 08:43:21 PM by hanhphuc »
( apply 'equal "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" ) ; error: too many arguments

reltro

  • Guest
Re: Fonts for grvecs
« Reply #31 on: May 28, 2014, 04:57:52 AM »
Hey People...
Short time ago I wrote a python-script to extract information out of a .pt3 (Font) to generate a lisp-function wich calculates the vertices of a text for the use with grvecs...

curves in the original font are ignored.

Wanna share some Fonts, and if somebody wants, the python-script...

greets
reltro
Great works !
dose these font-vectors maked by some tools ,which has a function tanslate shape into vectors ?

Hey chlh_jd...
Sry for the late response...
hm, I think I don't fully understand ur question... Wich kind of shapes do u mean?

The PythonScript I wrote is just a "parser" wich extracts the information found in a .pc3... Just hacked it togheter to fit my needs, so there is no functionality other than calculating the vectors of the Font... Specially for the use with (grvecs ...)

Sent u the PythonScript so u can look at ur own...

reltro
« Last Edit: May 28, 2014, 05:07:19 AM by reltro »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Fonts for grvecs
« Reply #32 on: May 29, 2014, 01:04:54 PM »
reltro,

I'd like to have a look at that script too, if you don't mind.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

reltro

  • Guest
Re: Fonts for grvecs
« Reply #33 on: May 29, 2014, 01:24:25 PM »
reltro,

I'd like to have a look at that script too, if you don't mind.


sure...
attached is a .py-file (python 3.3 on windows)
use this (http://onlinefontconverter.com/) to convert a font-file to .pt3 and then drag'n'drop it on the .py

greets reltro

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Fonts for grvecs
« Reply #34 on: May 29, 2014, 03:06:53 PM »
Thanks, bookmarked.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

chlh_jd

  • Guest
Re: Fonts for grvecs
« Reply #35 on: June 02, 2014, 05:37:21 AM »
Hey People...
Short time ago I wrote a python-script to extract information out of a .pt3 (Font) to generate a lisp-function wich calculates the vertices of a text for the use with grvecs...

curves in the original font are ignored.

Wanna share some Fonts, and if somebody wants, the python-script...

greets
reltro
Great works !
dose these font-vectors maked by some tools ,which has a function tanslate shape into vectors ?

Hey chlh_jd...
Sry for the late response...
hm, I think I don't fully understand ur question... Wich kind of shapes do u mean?

The PythonScript I wrote is just a "parser" wich extracts the information found in a .pc3... Just hacked it togheter to fit my needs, so there is no functionality other than calculating the vectors of the Font... Specially for the use with (grvecs ...)

Sent u the PythonScript so u can look at ur own...

reltro

Thank you very much .