Page 1 of 1

Control font size in dsl entry display

PostPosted: Fri Jun 10, 2011 10:59 am
by det
Is there any way to control the text size within a dsl-formatted entry -- by dsl tags or other? It would be nice to have certain elements larger or smaller than the rest of the entry. (e.g. a small-font footer with misc. notes at the end of the entry.)

Re: Control font size in dsl entry display

PostPosted: Fri Jun 10, 2011 11:09 am
by Tvangeste
Yes, to some extent, it can be done via CSS styling.

You need to edit article-style.css file (create it if you don't have such a file), in the same directory where config file exists. That will be either ~/.goldendict on Linux or C:\Users\YOU_NAME\.... somewhere there on Windows :). Or, if you have a portable install, just create that file in portable subdirectory.

Here's what I have in mine (examples are steelblue, and stress is darkblue):
Code: Select all
.dsl_ex
{
  color: steelblue;
}

.dsl_stress
{
  color: darkblue;
}


P.S. One hint to figure out which tags to use is to save any card to HTML, and then look at the generated HTML file and see which tags are used where.

Re: Control font size in dsl entry display

PostPosted: Fri Jun 10, 2011 12:14 pm
by det
Thanks - it's not a pretty solution, but it does work. I don't have any comments using the [com] tag, so I used that for the text I wanted in smaller font. But I'm now using the tags for something they weren't intended for, and I only have a few tags to work with. I noticed that creating my own tag (e.g. [small]) doesn't work.

Re: Control font size in dsl entry display

PostPosted: Fri Jun 10, 2011 12:39 pm
by Tvangeste
Yeah, that's the limitation of DSL format that we live with many years now. Basically, no control over sizes, no proper tables.

I was hoping that with the new Lingvo x5 release Abbyy, the authors of DSL format, could update it and improve a bit, but it seems that we'll have to wait a little bit longer for that...

On the other hand, DSL in its current form is very simple and straightforward and good enough for 99% of cases.

Re: Control font size in dsl entry display

PostPosted: Fri Jun 10, 2011 12:45 pm
by det
Yes, well it will work for now.

BTW, thanks for the tip about saving an entry to html -- I had not seen that before, and it is a helpful list for display questions.