Book a Demo

Author Topic: Changing font size  (Read 9524 times)

Fabio Riera

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Changing font size
« on: July 12, 2013, 02:23:40 am »
How do I change the font size of a text in the Notes property of an Element programmatically?

Example:

this is an [size=22]example[/size]

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Changing font size
« Reply #1 on: July 12, 2013, 04:49:12 am »
Hi Fabio,

interesting question. Also how to manipulate the text by html tags.

I just tried:
- Formatting the note by EA means (Size, Color,..)
- Visualize the note content by free addin EnArSpy (LieberLieber)
- SQL would also do

The formatting is coded by html tags. But there is also somewhere a flag to switch on the interpretation of html code.

I propose:
- Make a new *.eap file
- Make a class and a note (class note) with formatting by EA means
- Make a class and a note (class note) with the same text and without formatting
- select note As MyNote,* from t_object  (as search)

Hopefully you see the differences and the way interpretation html is switched on

May be another of the active community guys know a solution.

If you discover a solution I would be happy if you tell about your achievement.

It's a bit of try and error or waiting for someone who knows the solution.

Good luck and thanks,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Changing font size
« Reply #2 on: July 12, 2013, 08:33:28 am »
Use Repository.GetFormatFromField and its pendant.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Changing font size
« Reply #3 on: July 12, 2013, 08:41:47 am »
There is no size option in notes (either via the gui or setting any tag)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Changing font size
« Reply #4 on: July 12, 2013, 08:55:36 am »
Just sub-/superscript and color.

q.

Fabio Riera

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Changing font size
« Reply #5 on: July 12, 2013, 09:00:18 am »
When you right click a Text Element, there's a menu "Appearance/Set Font". In this dialog you can change the font size. There must exist a way to do this programmatically.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Changing font size
« Reply #6 on: July 12, 2013, 03:34:23 pm »
Fabio,

The best way to figure those things out is to start with an empty model, add the note or text or whatever you are trying to figure out, and then check what's been put in the database.

From there it's usually not difficult to figure out how to reproduce that using code.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Changing font size
« Reply #7 on: July 12, 2013, 08:07:57 pm »
Quote
When you right click a Text Element, there's a menu "Appearance/Set Font". In this dialog you can change the font size. There must exist a way to do this programmatically.
This renders the WHOLE element. Not the notes compartment.

q.

Fabio Riera

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Changing font size
« Reply #8 on: July 12, 2013, 10:20:02 pm »
Thanks for all replies.

Yes, It can be for the whole element.
Unfortunately, i don't have access to the database.

So, i will rewrite my question: how I change the font size of the entire content of a text element?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Changing font size
« Reply #9 on: July 12, 2013, 10:42:46 pm »
To change it globally (which is what F4 does) add the following to t_object.styleex:
Code: [Select]
font=Arial;fontsz=140;black=0;bold=1;italic=0;ul=0;
I'll have a look later how to do that with diagram objects only.

q.

[edit] Set similar values in t_diagramobjects. ObjectStyle
« Last Edit: July 12, 2013, 10:45:23 pm by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Changing font size
« Reply #10 on: July 12, 2013, 11:18:35 pm »
Quote
Unfortunately, i don't have access to the database.

You can simply make a local .eap file and open it with MS Access or any generic sql client.

And if you have access to the API then you have access to the database too. You can always use Repository.SQLQuery()

Geert

Fabio Riera

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Changing font size
« Reply #11 on: July 13, 2013, 06:52:49 am »
Thanks, qwerty!!!

Changing styleex property worked fine!