View Single Post
Old 09-14-2022, 06:50 PM   #66
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Turtle91 View Post
Smallcaps can be used with lowercase AND uppercase letters - and the uppercase glyph is used while still maintaining a font-size difference.
Exactly.

Quote:
Originally Posted by Turtle91 View Post
It is also using a font that looks like a telegram or an old typewriter.

It looks really nice actually!
It was straight out of a 1913 book (PDF)!

Quote:
Originally Posted by Hitch View Post
What is it precisely that you're demo'ing here, Tex?
Earlier in the thread there was some bad info going on about "all lowercase" smallcaps.

Quote:
Originally Posted by phillipgessert View Post
I'll be darned. Not sure where I got the idea that text-transform: lowercase didn't work against hard caps.
As always, MDN is a fantastic resource:

They even do a great job explaining all the localization issues. (Not all languages capitalize the same!)

If you want all the technical details, as always, the specs explain even more:

Quote:
Originally Posted by JSWolf View Post
Yes your code will work. But try this. You will not get small-caps.
I don't get what the heck you're trying to even get across. But I think it's because there needs to be concrete examples/screenshots.

This is the way I see it.

Here are 4 different "methods" of doing smallcaps:

Click image for larger version

Name:	Smallcaps.Example.png
Views:	150
Size:	11.0 KB
ID:	196517

Generated using this code (or see attached EPUB):

Spoiler:

HTML:

Code:
  <p><span class="sc1">NOW IS THE TIME FOR ALL GOOD MEN TO COME TO THE AID OF THEIR COUNTRIES.</span></p>

  <p>N<span class="sc2">OW</span> I<span class="sc2">S</span> T<span class="sc2">HE</span> T<span class="sc2">IME</span> F<span class="sc2">OR</span> A<span class="sc2">LL</span> G<span class="sc2">OOD</span> M<span class="sc2">EN</span> T<span class="sc2">O</span> C<span class="sc2">OME</span> T<span class="sc2">O</span> T<span class="sc2">HE</span> A<span class="sc2">ID</span> O<span class="sc2">F</span> T<span class="sc2">HEIR</span> C<span class="sc2">OUNTRIES</span>.</p>

  <p><span class="sc3">Now Is The Time For All Good Men To Come To The Aid Of Their Countries.</span></p>

  <p><span class="sc3">Now Is the Time for All Good Men to Come to the Aid of Their Countries.</span></p>
CSS:

Code:
p {
  font-family: "Liberation Serif", serif;
}

.sc1 {
  font-variant: small-caps;
}

.sc2 {
  font-variant: small-caps;
  text-transform: lowercase;
}

.sc3 {
  font-variant: small-caps;
}
(I only chose Liberation Serif because I know it has a high-quality smallcaps variant.)


If you want to keep smallcaps in your ebooks, what you should aim for is 3 or 4.

If, like Quoth said, you have oddities—like shrunken acronyms: "AM/PM", "NATO", or "FBI"—then it's up to you to decide what you want:

Click image for larger version

Name:	Smallcaps.Example.-.Acronyms.png
Views:	150
Size:	6.7 KB
ID:	196515

Spoiler:

HTML:

Code:
<p>I worked for the FBI.</p>

<p>I worked for the <span class="sc2">FBI</span>.</p>

<p>I worked for the <span class="sc">fbi</span>.</p>


But, let it be known:

This text-transform shenanigans won't work on Adobe Digital Editions (4.5):

Click image for larger version

Name:	Smallcaps.Example[ADE].png
Views:	156
Size:	27.5 KB
ID:	196518 Click image for larger version

Name:	Smallcaps.Example.-.Acronyms[ADE].png
Views:	150
Size:	16.5 KB
ID:	196516

so I would not rely on it for maximum compatibility.

Which is why, yet again, I recommend:
  • ALL CAPS acronyms
  • Title Case text as needed.
  • Apply <span class="smallcaps"> as needed.
    • (Version 3 or 4 above.)

Those devices that have proper small-caps support/fonts will display great.

Those that don't will still have a readable EPUB too!

- - -

Side Note: Acronyms are maybe the only case I could see JSWolf's text-transform being applicable.

But, personally, I wouldn't go through all the trouble of tagging every acronym with markup.

Side Note #2: If you did need to tag all acronyms though...

Have I told you about the great way to use Spellcheck Lists?

Similar to my "mark all foreign words" trick, you can:
  • Use "Change Selected Word To:"
  • FBI -> @FBI@
  • Use regex to convert to <span class="smallcaps">FBI</span>
Attached Files
File Type: epub Smallcaps.Test.epub (2.8 KB, 151 views)

Last edited by Tex2002ans; 09-14-2022 at 08:15 PM.
Tex2002ans is offline   Reply With Quote