![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
CSS to Approximate a Telegram?
Occasionally, I run into books where the author wants to show a telegram (wire, Western Union, etc.). Since I strip out embedded fonts (and read with a specific font set on my Kobo Forma), I can't really use a monospaced, san-serif font to show that. Anyone have any thoughts on some CSS to approximate a line or two of such a thing? Right now, as a first shot kludge, I'm considering something like:
Code:
.telegram { /* Style to look like a telegram */ display: block; font-family: "Courier New", monospace, Georgia, "Times New Roman", sans-serif; (<-- just in case) font-variant: small-caps; letter-spacing: -1px; margin-left: 2em; margin-right: 2em; text-indent: 0; } Last edited by enuddleyarbl; 09-02-2022 at 03:32 PM. |
![]() |
![]() |
![]() |
#2 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Are you reading ePub or KePub? How you handle fonts is different between the two. So the answer depends on which format.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,353
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
You said you strip out the embedded fonts and then you set a bunch of fonts that won't necessarily display unless you embed them???!??!? Why don't you just leave the embedded font that the publisher included...you'll be sure it has all appropriate licensing and such...
If you don't embed the font you cannot guarantee the device/app will have access to the font, unless you use basic "serif"/"sans-serif"/etc. As Wolfie mentioned some devices have issues with any embedded fonts, sooooo rotsa-ruck! From a purely CSS perspective you can try fiddling with these settings: Code:
font-family:sans-serif; font-size:.8em; letter-spacing:.3em |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
I read kepubs on my Forma.
As to my setting the fonts in the font-family line, I know it's pretty worthless. But, I was thinking of the cases where I'm editing the book and seeing it in the Calibre editor and viewer. And, that's silly of me. I'll remove the specific fonts and just stick with sans-serif family. Even so, with Georgia (which IS sans-serif) set on my Forma, it won't make any difference. Also, now that you mention it, I'll switch my units on the letter-spacing over to em. I think I only used the px because I saw it on the w3 site as an example and just blindly copied it. I normally use em units. Does font-size work with "font-variant: small-caps;"? I thought I'd read somewhere that it doesn't. I'd like to stick with smallcaps because I have an image in my brain of telegrams being all caps and if I'm going to have all caps, smallcaps might look better. If that doesn't work, I guess I could go with the smaller font-size and include a "text-transform: uppercase;" line. I strip out all the included fonts because I'm tired of every book I read looking entirely different from every other book (if I use the Publisher's Default) and my Forma is set to use Georgia, regardless. |
![]() |
![]() |
![]() |
#5 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
If you want small caps best not to rely on CSS font-variant but instead make a subset font of proper small caps (you can use Font Squirrel with a font that has small caps) and embed it. These can be keyed to capitals rather than lowercase so you still get caps if the device doesn't use the embedded font.
But small caps are too regularly aligned for a telegram. Why not use an actual telegram font? For example: https://www.fontspace.com/category/telegram |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
|
|
![]() |
![]() |
![]() |
#7 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
I thought originally you were talking about books where the author had asked you to represent the telegram, thinking you were preparing the epub for them for wider distribution, but now I see you're talking about books only you are reading. Well can't you keep that embedded font and use your preferred Georgia for everything else, if you're doing it for yourself?
Quote:
Last edited by bookman156; 08-31-2022 at 10:18 PM. |
|
![]() |
![]() |
![]() |
#8 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
Regarding Georgia, that's embarrassing. I swear I recently checked and it was listed as a sans-serif font. But, I just double-checked and you're right, it's serif. Worse, just by looking at it, it's obviously got serifs. But, thanks for the correction. Anyway, I did consider just embedding Georgia in all my books and switching to Publisher Default on the Forma. But, I just got lazy and let the ereader handle it. Usually, there's not an issue with the way things look. But, recently I was editing some of the Lord Peter Wimsey books by Dorothy Sayers, and she specifically uses quite a few telegrams in them. So, I thought it would be neat to approximate those without using special fonts. It's interesting that my initial thoughts on telegrams were that they were all-cap, sans-serif and condensed. But, looking at examples, I see both all-cap and mixed case, serif, and the characters are actually pretty spaced out. Monospace is a much closer look than sans-serif. So, without going with a special font, I don't think I can get any closer than something like Turtle91's suggestion earlier (though I reduced his letter-spacing from 0.3em to 0.08em). |
|
![]() |
![]() |
![]() |
#9 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
As for small-caps, that will work in KePub. You may want to add in a text transform in case the text is all uppercase. Code:
.smallcaps { text-transform: lowercase; font-variant: small-caps; } What I do with embedded fonts is see what the font is and where it's being used. I do make sure that the main body font is not using an embedded font so I can use my choice. But things like chapter headers, telegrams, and other things, I might leave the embedded fonts. |
|
![]() |
![]() |
![]() |
#10 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,033
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
No, don't use small caps (doesn't work on everything). Just use monospace like courier and enter the text in caps (works even on prehistoric Kindles).
Telegrams just used ordinary monospaced caps. You don't need to embed if you declare monospace and courier in CSS. Conversion for epub to mobi by Amazon works. You can optionally bold it. Last edited by Quoth; 09-01-2022 at 06:49 AM. |
![]() |
![]() |
![]() |
#11 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,353
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Yes, font-size works on small-caps.
Since this is just for your own personal use on a device that supports font-variant:small-caps then there is no reason NOT to use it...if that is the style you are looking for. Sorry, Jon, but making everything lowercase and then small-caps defeats the purpose of small-caps....which is to differentiate between upper, and lower, case letters but using the capital style of the letter. Code:
THIS IS SMALL-CAPS THIS IS UPPERCASE IN A SMALL FONT-SIZE OR LOWERCASE IN SMALL CAPS If you were worried about distribution of the ebook and widespread compatibility...then small-caps isn't supported very well and you would need to use some of these work-arounds. Last edited by Turtle91; 09-01-2022 at 07:15 AM. |
![]() |
![]() |
![]() |
#12 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
Quote:
https://www.fontsplace.com/ld-telegr...-download.html |
|
![]() |
![]() |
![]() |
#13 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
[QUOTE=Turtle91;4253634]
Quote:
I've just tested this in the Calibre editor. I made a few words uppercase and then used a span around those words and a few others in lower case and only the lower case words were in smallcaps. |
|
![]() |
![]() |
![]() |
#15 | |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,033
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Quote:
So no "small caps" use CAPS SOURCE. It's a Telegram, not a paragraph intro. Do the CSS with an embedded monospace font of choice and declares to suit things that don't use embedded. I have formatted ebooks simply by converting docx and had monospace (for a Terminal session) work on everything (kepub, epub, same epub to Amazon and download sale of mobi, azw3 and KFX). |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Concept] Telegram Bot for converting epubs to kepubs (and transferring) | Tommalka | Kobo Developer's Corner | 2 | 01-01-2022 04:03 AM |
Recipe request: Worcester Telegram | NSILMike | Recipes | 0 | 12-31-2020 08:52 AM |
Worcester Telegram Recipe request | NSILMike | Recipes | 0 | 10-11-2020 07:39 AM |
Green Island - Telegram-channel for authors and writers of books | Phil J. Parker | Self-Promotions by Authors and Publishers | 0 | 06-26-2018 02:23 PM |
E-readers chat (telegram, whatsapp)? | Mochy | Android Devices | 4 | 07-28-2015 08:46 AM |