3 ms·
Do you have NoScript or some other blocker on? As far as I can tell, Economist.com is using smallcaps for all acronyms but for some reason, the smallcaps are im
by gwern 6y ago
Do you have NoScript or some other blocker on? As far as I can tell, Economist.com is using smallcaps for all acronyms but for some reason, the smallcaps are implemented solely through JavaScript, so if you read without that, you just see lower-case. The lowercase is because if you have uppercase, smallcaps does nothing - it can't become 'small capitals' because it's already large capitals, as it were. Letters need to be lowercase to be smallcaps. So, that's why you see 'ai' instead of 'AI'. So the 'ai' can properly transform into 'ᴀɪ'.
This is bad because JS is not necessary, and it is also not necessary to write in lower-case in the first place! I know this because I do a similar thing on gwern.net: in addition to manually-specified smallcaps formatting, a rewrite pass while compiling automatically annotates any >=3-letter acronym. However, I do it purely via CSS, and I also don't need to lowercase anything. How? Because a good font like Source Serif Pro will include a special feature which will smallcaps just capital letters: 'c2sc' in `font-feature-settings` CSS. So to do smallcaps correctly, of regular text & uppercase, you have 2 CSS classes: "smallcaps" and "smallcaps-auto". "smallcaps" gets the normal 'smcp' font feature and operates the usual way, lowercase gets smallcaps, uppercase is left alone. "smallcaps-auto" is used by the acronym rewrite pass, and it does ''smcp', 'c2sc'' instead, so "AI" does indeed get smallcaps.
This way, I need 0 JS, I don't need to write everything in lowercase, copy-paste works perfectly, I don't need to manually annotate acronyms unless I want to, and everything Just Works for every reader.
(I don't, however, smallcaps two-letter things like "AI". That's just silly looking.)
- pengaru 6y agoAh, yes, I am using noscript. That explains it, javascript is destroying the web.
- quicklime 6y agoI just disabled JavaScript by setting Firefox's "javascript.enabled" flag to false, and it still renders fine for me. Here's what the HTML source looks like when I grab the page using curl: predicts that artificial intelligence (<small>AI)</small> will add $16trn to the global economy by 2030 So it looks like it's coming through in caps from the server. I don't think a lack of JavaScript by itself is causing the problem...
- gwern 6y ago> I don't think a lack of JavaScript by itself is causing the problem... <small>, however, does not do lowercasing. All it does is make the font smaller. 'AI' should be caps regardless of whether it is wrapped in <small> or not. That implies that something in the CSS or HTML is overloading <small> to make it lowercase, so it can be correctly transformed to uppercase smallcaps for the reasons I explain above, which it assumes will be done by the later JS (which however doesn't run under NoScript). Using <small> just makes it an even uglier unnecessary hack...