typography

Algorithm to implement a word cloud like Wordle

五迷三道 提交于 2019-12-17 04:09:25
问题 Context Take a look at Wordle: http://www.wordle.net/ It's much better looking than any other word cloud generators I've seen Note: the source is not available - read the FAQ: http://www.wordle.net/faq#code My Questions Is there an algorithm available that does what Wordle does? If no, what are some alternatives that produces similar kinds of output? Why I'm asking just curious want to learn 回答1: I'm the creator of Wordle. Here's how Wordle actually works: Count the words, throw away boring

@font-face and font-variant bad idea?

最后都变了- 提交于 2019-12-14 03:47:58
问题 if i use @font-face font and font-variant: small-caps for the same selector the font will fallback to the next system default font in safari. how do i get around that? 回答1: I had some trouble creating an example to replicate your issue at first, which made me realize that font-face is not a standard CSS2 attribute; the equivalent is font-family. So I did some quick research on @font-face, and found that it's -- depending on how you look at it -- either a non-standard attribute specific to

rem units do not affect DIVs in Chrome - side-effect of minimum font size setting

99封情书 提交于 2019-12-14 03:32:09
问题 I've stumbled upon a very bizarre case, where rem units were not affecting DIV s (and potentially all other block elements), but were still effective against text (and I suspect all other inline elements). This was happening on one Windows computer only and only in Chrome 74. On all other platforms (Linux, Mac OS X) and other browses (even legacy Safari and in Canary, which is at Chrome 76 at the moment it worked as expected). I had no chance to test it extensively, but I've witnessed it

How to get the raw text from a Flutter TextBox

孤者浪人 提交于 2019-12-13 03:19:32
问题 In Flutter, after a Paragraph or TextPainter has laid out it's text, you can get the Rects for the lines (or runs within a line) by calling getBoxesForSelection . If you draw the actual boxes they look something like this: How do I programmatically get the text within each TextBox? 回答1: I wish there were a better way, but this is the only way I have found so far: // The TextPaint has already been laid out // select everything TextSelection selection = TextSelection(baseOffset: 0, extentOffset

Gradual italics?

梦想的初衷 提交于 2019-12-12 11:00:47
问题 Is there a way to gradually transition from normal text into italics changing the slant angle ever so slightly with each character? 回答1: Robin's idea does work (DEMO), but there are so many things wrong with that fiddle I wasn't sure I could fit them into one comment. First of all, span is an inline element and transform works on block elements. So you either use a block element like div or p or you set display: block on the span . Don't use skew ! Use skewX . skew was present in the early

IE9 text rendering issue - tails on letters cut off

我是研究僧i 提交于 2019-12-12 09:33:33
问题 I'm running into an issue where - in IE9 standards mode - IE9 renders text in such a way that the tails on descending letters - "q, p, y" etc - disappear. Have tried playing with padding and other common CSS settings in helps of fixing this but am having no luck so far. Who's got an idea what this might be? 回答1: EDIT: I found this on a blog. The link isn't live anymore. Leaving it here just in case it pops up again. Its as though the text is a node inside the input and the line-height has

how to get smart quotes on org-mode export?

牧云@^-^@ 提交于 2019-12-12 08:37:24
问题 How do I get Emacs org-mode to create proper typographic marks when I export to HTML, including converting straight quotes to smart quotes ("curly quotes") and converting hyphens --- to m-dashes — ? 回答1: #+LANGUAGE: de #+OPTIONS: ':t also does the right thing now 回答2: This is only available in very recent versions of org-mode. If you are not already running the latest git version see http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development for instructions on upgrading.

How to use All-Caps in First Line of paragraph in Webkit Browsers (Chrome, Safari)

被刻印的时光 ゝ 提交于 2019-12-12 01:58:20
问题 The CSS property text-transform and the pseudo-element ::first-line have been part of CSS spec for a long time, but for some reason unknown to humanity, Webkit browsers still don't allow these to be combined. The combination works seamlessly and as expected in Firefox and "modern versions of IE" (which used to be an oxymoron). Is there a workaround for this? (ideally without utilizing javascript) I would like to use CSS to style the first line of a paragraph to be in all caps, and it should

Angular Material Typography doesn't work properly

我的未来我决定 提交于 2019-12-11 14:59:03
问题 I am trying to create my custom theme for Angular Material but when I apply the typography some elements change its own fonts but not in all the application. For example, for links doesn't works and for grid lists elements neither(I didn't notice if it occurs with more material components). Here is my code: font.scss @import url('https://fonts.googleapis.com/css?family=Indie+Flower&display=swap'); $fontConfig: mat-typography-config( $font-family: "'Indie Flower', cursive", $display-4: mat

Can anyone explain “em is relative to the font size and % is relative to the parent element” by example?

给你一囗甜甜゛ 提交于 2019-12-11 12:29:10
问题 Can anyone explain "em is relative to the font size and % is relative to the parent element" by example? What is the means of relative to the font size and relative to the parent element? 回答1: Consider if you're defining the height of a box inside another box. If you specify the height at 50%, it will be half as tall as the box it's contained within. if you specify the height in ems instead, its height will depend on the size of the letter m in whatever font you're using, and not be dependent