Is there any advantage/disadvantage to using:
highlight text, click the B button for bold (or Ctrl-B) - (inserts <text style="font-weight:bold;">)
vs
highlight text, select Style BOLD - (inserts <text styleclass="Bold">)
If one is better than the other, looks like I can do a global search and replace and swap one for the other?
Styles vs Font Formats
Moderators: Alexander Halser, Tim Green
- Tim Green
- Site Admin
- Posts: 23386
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Styles vs Font Formats
Hi Jep,
The two main advantages of a style would be that with a text style you can a) configure your "bold" to be anything you like, and b) the XML is slightly briefer, although in the case of bold, underline and italics that is really minor. For those three things I would say that it is really up to you. That is also why the Normalize Styles feature in the Premium Pack power tools allows you to leave those untouched when eliminating all inline formatting in your project.
Over and above those three, however, I would strongly recommend using text styles rather than inline formatting as a general principle. In addition to being impossible to change later globally, inline formatting causes massive bloat in your XML and also the resulting HTML in your output. This can actually cost you money when using DeepL machine translation for your projects because DeepL charges for ALL the characters in your XML files, not just the translated text.
The most extreme case of this can be imported, manually-formatted Word files, which can easily consist of over 90% just formatting code. They are quite scary to look at...
The two main advantages of a style would be that with a text style you can a) configure your "bold" to be anything you like, and b) the XML is slightly briefer, although in the case of bold, underline and italics that is really minor. For those three things I would say that it is really up to you. That is also why the Normalize Styles feature in the Premium Pack power tools allows you to leave those untouched when eliminating all inline formatting in your project.
Over and above those three, however, I would strongly recommend using text styles rather than inline formatting as a general principle. In addition to being impossible to change later globally, inline formatting causes massive bloat in your XML and also the resulting HTML in your output. This can actually cost you money when using DeepL machine translation for your projects because DeepL charges for ALL the characters in your XML files, not just the translated text.
The most extreme case of this can be imported, manually-formatted Word files, which can easily consist of over 90% just formatting code. They are quite scary to look at...

Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Re: Styles vs Font Formats
Thanks. Using Notepad++ it is easy to do a global search/replace to make all the formatting use "styles".
- Tim Green
- Site Admin
- Posts: 23386
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Styles vs Font Formats
Yep.

Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.