additional CSS features for Author mode

Are you missing a feature? Request it's implementation here.
friedemann_bach
Posts: 48

additional CSS features for Author mode

Thu Oct 15, 2015 4:01 pm

Dear Forum,

is there a chance that the Author mode will support one or more of the following CSS features in one of the next releases?

  • property/value "font-variant: small-caps"
  • property "text-decoration-color"
  • selector "::first-letter"

This would be of relevance when configuring the Author mode, mainly for working with historical texts. The most important one would be Small-Caps, which would be useful to make the text more similar to the historical appearance. Text-Decoration-Color would be great to represent semantical markup with colors. ::First-Letter would be "nice to have" for representing larger initial letters in a paragraph.
Radu
Posts: 5459

Re: additional CSS features for Author mode

Fri Oct 16, 2015 9:31 am

Hi,

Please see some possible answers below:

property/value "font-variant: small-caps"


We do not yet have support for this, we tried to do this once but we do not seem to have much support in the Java VM for it.
But there are free TTF fonts which render with small-caps by default (you can google for "TTF small caps font").
And Oxygen can dynamically load a font using the CSS font-face property:

https://www.oxygenxml.com/doc/versions/17.0/ug-editor/#topics/dg-font-face-media.html

so instead of using small-caps font variant you could change the font-family on that element to use a particular font which renders everything with small caps.

property "text-decoration-color"


Oxygen should support this already. Could you give me a small example of what your CSS selector looks like?

selector "::first-letter"


I will add an improvement request for this. Could you tell me about your use-case?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
friedemann_bach
Posts: 48

Re: additional CSS features for Author mode

Fri Oct 16, 2015 5:08 pm

property/value "font-variant: small-caps"
We do not yet have support for this, we tried to do this once but we do not seem to have much support in the Java VM for it.
But there are free TTF fonts which render with small-caps by default (you can google for "TTF small caps font").

Good workaround, this works fine in our case. Thanks!


property "text-decoration-color"
Oxygen should support this already. Could you give me a small example of what your CSS selector looks like?

Sure:
in XML(TEI): <hi rend="underline">Beobachter</hi>
in CSS: text body hi[rend~='underline'] { text-decoration:underline; text-decoration-color:red; text-decoration-style:double; }

It is rendered double underlined, but not red. I am still using Oxygen 16, so maybe I just have to update?


selector "::first-letter"
I will add an improvement request for this. Could you tell me about your use-case?

Of course. We are working with historical texts and use Oxygen Author for transcriptions. It would be nice to configure the transcription Author mode in a way that looks similar to the original design. In many of our historical texts, sometimes the first letter of a paragraph is enlarged. This is documented in an attribute on the paragraph (@rendition in TEI). Of course, we could also enclose the initial letter in another element, but it would be more convenient for the editors if it was possible to deduce the design by the rendition attribute of the whole paragraph.
Radu
Posts: 5459

Re: additional CSS features for Author mode

Mon Oct 19, 2015 9:47 am

Hi,

in XML(TEI): <hi rend="underline">Beobachter</hi>
in CSS: text body hi[rend~='underline'] { text-decoration:underline; text-decoration-color:red; text-decoration-style:double; }
It is rendered double underlined, but not red. I am still using Oxygen 16, so maybe I just have to update?


Sorry about that, I managed to reproduce the problem on my side and we'll probably fix it in Oxygen 18.0 (next year in Spring).
A workaround for this could be done using a double bottom border like:

Code: Select all

hi[rend ~= 'underline']{
    border-bottom:double red;
    text-decoration:none;
}


Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
friedemann_bach
Posts: 48

Re: additional CSS features for Author mode

Mon Oct 19, 2015 12:26 pm

Great, thank you!
Radu
Posts: 5459

Re: additional CSS features for Author mode

Wed May 04, 2016 3:27 pm

Hi,

The problem with the "text-decoration-color" CSS property should be fixed in Oxygen 18.0.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
joerg.hambuch
Posts: 19

Re: additional CSS features for Author mode

Tue May 08, 2018 4:45 pm

Hello,

I just tried small-caps in oXygen XML Editor 20. As far as I can see, the CSS features

Code: Select all

:first-letter
and

Code: Select all

font-variant: small-caps;

still are not supported by oXygen.

This is the relevant part of my CSS:

Code: Select all

[rend="kapitaelchen"] {
    text-transform: uppercase;
    font-variant: small-caps; /* non-functional in oXygen? */
    font-size: 80%;
}

[rend="kapitaelchen"]:first-letter { /* ::first-letter seems to be non-functional, too. */
    font-size: 100%;
}

This is the XML code snippet:

Code: Select all

<katalognachweis>
   <hi rend="kapitaelchen">fehlt</hi>
</katalognachweis>


Please tell me I am just missing something.

Best regards,
Jörg Hambuch
Radu
Posts: 5459

Re: additional CSS features for Author mode

Wed May 09, 2018 7:35 am

Hi Jörg,

You are correct, our Author visual editing mode does not have support for ":first-letter" and font-variant small-caps.
If at some point we manage to add this support we'll update this forum thread.
The workaround for "small-caps" could be an idea I posted in this same thread, loading in the CSS and using a specific font which only displays as small-caps.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “Feature Request”

Who is online

Users browsing this forum: No registered users and 3 guests