text-rendering

What's the Difference between EndEllipsis and WordEllipsis in TextFormatFlags enum?

主宰稳场 提交于 2019-12-10 19:50:31
问题 According to my understanding of the documentation, when using TextFormatFlags.EndEllipsis the text should be trimmed to fit inside the display rectangle and replaced with an ellipsis: EndEllipsis | Removes the end of trimmed lines, and replaces them with an ellipsis. When using TextFormatFlags.WordEllipsis , the text should be trimmed to the last word that fits inside the display rectangle, and add an ellipsis: WordEllipsis | Trims the line to the nearest word and an ellipsis is placed at

How can I stop the transparent background of multiline text overlapping between lines?

爱⌒轻易说出口 提交于 2019-12-10 18:09:07
问题 I'm facing an issue where I have an inline <span> containing multiline text, with a transparent background. Despite having a default line-height, the background on the text overlaps, causing darker, horizontal rows where the background is overlaid onto itself. Here is a good demonstration of the problem (image + jsfiddle) JsFiddle demonstrating this issue. Minimal reproduction of issue HTML: <h1> <span>Although it is set to a line height of 1, the background behind text still overlaps between

Part 2 - How do I get consistent rendering when scaling a JTextPane?

落花浮王杯 提交于 2019-12-10 10:22:58
问题 I submitted another version of this question and a sample program before: How do I get consistent rendering when scaling a JTextPane? Recapitulating the problem: I would like to allow users to zoom into or out of a non-editable JTextPane. Running the example program submitted in the earlier question, which simply scaled the Graphics object, resulted in inconsistent spacing between runs of bold text and non-bold text. The sample program below attempts to solve the problem by drawing the text

How can I achieve pixel-perfect positioning and spacing of textual elements across browsers?

末鹿安然 提交于 2019-12-09 13:53:04
问题 Right now, we are trying to achieve consistent formatting of textarea elements, across Safari/Chrome/Firefox/IE on Mac and Windows. I believe this may be a rabbit hole, since any combination thereof could produce formatting in a slightly different way -- maybe one combination adds a bit of padding to a div here differently than the others, another one breaks multi-line text there differently than the others, and so on. Instead of using textarea (or div ) elements, can we achieve pixel-perfect

'Lato' font rendering odd in safari, not in chrome, or firefox

北战南征 提交于 2019-12-09 05:09:17
问题 Im using the 'Lato' font from google web fonts, and its displaying fine on all browsers apart from safari. Im using it in font-weight:100; here are some screen shots of the different browsers. Any idea what might be causing it to render extremely thin ? Or if theres a way i can set it to render in font-weight:300; for safari only ? Ive also made a js fiddle of the problem - http://jsfiddle.net/qLHuc/1/ FIREFOX CHROME SAFARI 回答1: I'm not sure why, but Safari is disabling subpixel antialising

Calculating width of a string on Android

余生颓废 提交于 2019-12-07 10:12:54
问题 I need to know width of text string given font handle (or font name + font size + font style data). in Windows I used to use GetTextExtentPoint() 回答1: use this code Rect bounds = new Rect(); Paint textPaint = textView.getPaint(); textPaint.getTextBounds(text, 0, text.length(), bounds); int height = bounds.height(); int width = bounds.width(); 回答2: You can get TypeFace of TextView: http://developer.android.com/reference/android/widget/TextView.html#getTypeface() but it's hard to get font

WPF application freezes when rendering text (wpfgfx issues)

血红的双手。 提交于 2019-12-05 23:41:04
问题 TL;DR: application is built with WPF, running on .Net 3.5 newest and older versions of the app work properly on many different machines on one specific machine it malfunctions in a strange way: either does not start, displays black screen instead of "welcome" screen; can't do anything on that black screen or does start and works properly, until a TextBox is presented and until the user starts entering the text into it; then application immediatelly hangs Background: I have built a WPF

Calculating width of a string on Android

只愿长相守 提交于 2019-12-05 12:37:07
I need to know width of text string given font handle (or font name + font size + font style data). in Windows I used to use GetTextExtentPoint() use this code Rect bounds = new Rect(); Paint textPaint = textView.getPaint(); textPaint.getTextBounds(text, 0, text.length(), bounds); int height = bounds.height(); int width = bounds.width(); maszter You can get TypeFace of TextView: http://developer.android.com/reference/android/widget/TextView.html#getTypeface() but it's hard to get font family, check also this: Check the family of a Typeface object in Android 来源: https://stackoverflow.com

Matplotlib 2 mathtext: Glyph errors in tick labels

送分小仙女□ 提交于 2019-12-05 06:13:04
I've observed errors when rendering math in matplotlib 2.0.2, when using the default mathtext as opposed to the LaTeX math rendering engine. It seems that some glyphs (in my case the minus and the multiplication sign) is not recognized by mathtext. What makes it really weird is that the error only occurs when these particular glyphs appear in tick labels. When I deliberately type some mathy expression into e.g. the figure title, it works fine. Consider the below example and the resultant image: import matplotlib import matplotlib.pyplot as plt # Customize matplotlib matplotlib.rcParams.update(

Devanagari text rendering improperly in PyGame

余生颓废 提交于 2019-12-05 01:17:31
We have a small web app that we want to convert into something native. Right now, it's got a lot of moving parts (the backend, the browser etc.) and we'd like to convert it into a single tight application. We decided to use PyGame to do this and it's been fine so far except for a font rendering issue. The string I'd like to render is कोझिकोड. This, correctly rendered looks like . The specific code points are \u0915 \u094b \u091d \u093f \u0915 \u094b and \u0921 Now, this looks fine in my editor and my browser but when I try to render it in PyGame, I get this . Basically, the vowel sign (\u093f