[Screenshot included] Make Opening *Line* Uppercase

I’ve seen many books Uppercase the entire line of an opening section, but the number of words that entails will always vary. I can’t imagine the complexity of code required to pull this off, but just thought I’d throw it in the mix anyway. Sample screenshot below (toggle between Line or Word Count. Preview of effect included for clarity).

Many thanks for your consideration. I realize this is probably not worth the effort but just wanted to mention it anyways. Cheers!

Thanks for the suggestion. I’ve never actually seen this in a book myself, so I’m guessing it’s not that common. This is actually quite a difficult proposal. The problem is this:

  • I only control the layout of PDF and print. For all other formats, such as Word, RTF and so on, I have no idea where lines will wrap (and they may wrap differently in different word processors), so it wouldn’t be possible to use the option for such formats.

  • With PDF and print, the text gets constructed and then placed into the pages for layout, so I don’t know the line length until after all of the text has been generated. Although it would be possible to then have the code go through the laid-out text and recapitalise at that point. But even then it gets hard: for some fonts, changing the text to all-caps (or small-caps) may change the width of the characters, which may cause some letters that were on the line to spill over to the next, or letters that were on the next line to be moved up. So if I find the letters on a line and capitalise them, after capitalisation there may be different letters on the line, causing it to be wrong. So it’s actually quite tricky to calculate.

All the best,