Anushka Posted December 23, 2024 Posted December 23, 2024 I'm trying to add a larger text to my DCL, and for that, I created a custom function that generates a vector_image: (defun _dialogtext (key str) (set_tile key str) (start_image key) (vector_image 0 (1- (dimy_tile key)) (dimx_tile key) (1- (dimy_tile key)) -15) (end_image) ) In AutoCAD, when using width = 50.5, the result is perfect. However, in BricsCAD, the text appears smaller and is not fully displayed, as shown below: BricsCAD: When I increase the length, the text is no longer centered and part of it sticks out. My question is: how can I center this text in this context? Also, is it possible to increase the font size to make the text larger? (defun c:demo () (defun _dialogtext ( key str ) (set_tile key str) (start_image key) (vector_image 0 (1- (dimy_tile key)) (dimx_tile key) (1- (dimy_tile key)) -15) (end_image) ) (setq dcl_id (load_dialog "demo.dcl")) (if (not (new_dialog "demo" dcl_id)) (progn (alert "Erro") ; (exit) ) ) (_dialogtext "active_text_1" "Create ideas, innovate, and transform your future!") (setq value (start_dialog)) (if (eq value 1) (prompt "OK!") ) ) demo : dialog { label = "Demo"; : column { // width = 90; spacer; : image { key = "active_text_1"; fixed_width = true; fixed_height = true; alignment = centered; height = 1.3; width = 60.5; aspect_ratio = 1.2; color = 1; } spacer; ok_cancel; } } Quote
rlx Posted December 23, 2024 Posted December 23, 2024 (edited) have done something somewhere sometime : Maybe you can adapt it for your purposes. for the font , think this is system setting : https://stackoverflow.com/questions/73750384/does-a-dcl-fonts-reference-exist BricsCad I don't have but maybe attribute 'typeface' could work : https://developer.bricsys.com/bricscad/help/en_US/V9/DevRef/source/IDR_DCL_B39.htm Edited December 23, 2024 by rlx Quote
Anushka Posted December 28, 2024 Author Posted December 28, 2024 To center: Is the only method to calculate the size and add spaces? To increase the font size: I am already using the method suggested in the link to increase the font, but I would like to increase it a bit more. Quote
Steven P Posted December 28, 2024 Posted December 28, 2024 Pretty much, DCL isn't an easy a graphical interface, it works well on a grid but variable things like centre text it struggles with. Have to calculate things. One thing I did do once was to create an alphabet of vector images and use each vector in an image to create text, which gives the result you want... however this was a lot of work to draw them all out, and untested in BricsCAD - it should work but might not. Also allowed for image buttons - click on the text to do stuff, text and background of every (colour book) colour. How important is it to get this text centred in AutoCAD and BricsCAD and compared to the work required to make it work is it worth the effort? 1 Quote
BIGAL Posted December 29, 2024 Posted December 29, 2024 You can very much a maybe use "strlen" which is how many characters in a string, so using some fuzzy factor for a character width * strlen, make the dcl WIDTH to suit. Not tested. Looking in the bible, Autocad R12 customization manual, there are other tiles such as text and paragraph that may be useful. Page 164 talks about using text with changing values eg "Northing X Easting Y" where the values of X & Y are supplied. "Northing 123.456 Easting 789.678" Uses text_part in dcl, in conjunction with paragraph. Or may be use an edit box using above method. If get time may have a go at using the other dcl options. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.