-
-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better MText #1286
Comments
Dear CivilGuy, I am particularly interested in this feature. I do not know if this is a problem of miscondiguration in my libercad but I am haviong problems with any interpretation of the MTEXT in dwg when opened from LibreCAD.,e.g. the text "{\pqc;\fArial|b0|i0|c0|p38;BATIMENT VOISIN N°99}" appears in the LibreCAD text box instead of importing as text just "BATIMENT VOISIN N°99" and using the rest of the tags for configuration. There is information on wht some codes are at Are you working on it? How can I help or contribute? |
It turned out to be more complex than I had thought and I put it aside to work on other interests. I've got things maybe 50% worked out. I have very little formal training in programming, and I admit that what I do have is very incomplete from a testing standpoint. |
This is indeed a feature that would improve a lot the way I can see the dwgs of my architect. Is there a way to make more relevant this feature?. I am looking forward to see your code and if I can contribute. {\pqr;\fArial|b0|i0|c0|p38;Revêtement mur pignon-mitoyen en ardoises gris\fArial|b0|i0|c0|p38; \fArial|b0|i0|c0|p38; ton foncé} So, the code should realise that the mtext starts with "{" and decode it accordingly. There is no need to alter the text but just to interpret it accordingly when putting it in the drawing or in the Text box of the properties. For the aforementioned code: \pqr should change the lining and then not be shown in the text box (the same goes for pql and pqc \fArial|b0|i0|c0|p38 should make the appropriate changes to the font. I realise that the text may have different fonts and styles in the same box and I do not know to what extend this is feasible in the current properties mtext box, which is the case of the mentioned line. However, a good start would be to consider only one style and format and format the whole box on that . The code will be improved the code from there on. |
Do you have any coding experience yourself? LibreCAD 2 is written in C++, and the changes I'd be making would use terminology from that, as well as from Git and QT, other components that LibreCAD is built around. I've put together a text file showing what I'm working on and what I hope to accomplish. |
I wouldn't say I have strong professional Coding experience as I have never made a living by with just coding. Although I studied ICT engineering my professional life has been rather at project management rather than implemenation. Anyway, I started coding more than 3 decades ago with my C64 both BASIC and ASM. Afterwards I passed to Pascal as it was part of a subject in university and later I had no escape from learning C as it was more ubiquotiuos. Of course I followed the derivatives, Delphi, Java but the internet era had arrvived and I moved to combining PHP and Javascript for my HTTP server. Lately I have learned Python because of its wide spread. Of course given my work I get more use from VBA. To tell you the truth I have never been fond of OOPs but I have no issue. Concerning C++, I have never coded on it (but Java) although I remember reading some book on it. I had enough with Delphi at the time and I was more productive with it. Anyway, if LibreCAD is in C++, no matter in adapting. |
I have looked in the code and it does seems feasible to do a correct interpretation of strings. From what I see, the fucntion to modify is |
I think I've previously seen the page that lordofbikes provided (or an earlier version, maybe). It's a good reference, but it's incomplete. I've shown a more complete list in my notes above. |
I've noticed that there are various features missing in the LibreCAD use of MText. The 'rich codes' that it recognizes are fairly limited.
In particular, I'd like to add in the features for setting a character width factor and underlining. I'd like MText able to set text into a list format. To do that, the app code should be able to automatically wrap text into a given box width.
Since no one else seemed to be working on it, I thought that I'd try my hand at it. The code will involve a rewrite of file rs_mtext.h and rs_mtext.cpp. I've got local draft code maybe 80% complete. It can be found at my fork of LibreCAD, https://github.com/CivilGuy/LibreCAD, branch CG_MText
I'd like to discuss what I've done with anyone who wants to hear about it. I've got a stream started on Zulip for the subject CodeBase/V2 MText.
Thanks.
The text was updated successfully, but these errors were encountered: