underline line thickness always one pixel - apache-flex

...regardless of font size.
Its an mx:Text object. (The Text object is actually being used as a mask so don't know if that's the problem.) If underline is set with the <u> tag in Text.htmlText, or Text.textField.setTextFormat, the underline thickness is always just one pixel which is not acceptable. (There are other problems with <u> so I'm limited to using setTextFormat currently.)
Can the thickness of an underline be set through CSS? (textField.styleSheet, etc.)
I may have another problem as I already use setTextFormat extensively, and the documentation says you can't use textField.setTextFormat if you use textField.setStyleSheet.
I primarily need the underline to simulate correctly the look for an anchor tag.

its not even possible to do in html (you need to use border-bottom). i don't think this is possible.

Not possible with CSS or TextFormat.
A possible workaround would be using the textfield metrics (probably through getCharBoundaries()) to manually draw a line under the desired text. It can get quite messy for multiline text though.

Related

Line-Breaks and Typography in CSS

I would like to know if it is possible to have line-breaking text that sometimes consists of one line and sometimes of two. I can best describe what i mean it with an image:
You would have to insert the text into separate elements which have the shape and size you want to achieve the effect you are going for. It is not possible with just one html tag.
As Watson said, you'll have to contain the elements in containers of a specific shape and size. You can't make them truly "fluid" as I think you're meaning to comment, however, you can use percentages for those containers to determine how much text is visible in space and possibly viewport sized text to try and properly fill those spaces. Definitely no manner in my mind that will allow you to easily create this in a universal method for all browsers. You're going to have a lot of ragged edges I'd suspect.

How to limit QPushButton from bieng smaller then the size of its text?

Unexpectedly for myself I found out that buttons impudently ignore the size of the text and easily cut it with a decrease.
Is there something like sizeAdjustPolicy as at QComboBox? If not, what is the correct decision?
In Google and other places I didn't find anything intelligible.
Thanks in advance!
edit2:
I used Qt Style Sheets, cleaned - works fine. Have to give up beauty.
Solution: it was in Qt Style Sheets. If there to use min-width property then something spoils and the button ignores the text size.
To prevent a button from getting too small, set its horizontal size policy to MinimumExpanding. I don't see a reason to use stylesheets for that.
If you wish to manage the size of the button yourself, you can get the minimum size hint of any control by using the minimumSizeHint method.
It was in Qt Style Sheets. If there to use min-width property then something spoils and the button ignores the text size.
You can refer to this question to determine the text size and set the button width according to it using QFontMetrics.

blockUI - change font-family & remove padded area on overlay?

Using blockUI. I looked through the options in the documentation, through the plugin itself, and even here on stackoverflow and I can't find where to change the font-family declaration for this. It appears to be using Times by default. Also, the font is displayed over a padded area. Is there a way I can remove that padded area part, I want only the text on top of the dimmed screen. Thanks.
Use message option for this.
Document here http://jquery.malsup.com/block/#options

How to use "two-toned" font variants in CSS?

Certain fonts have a variant for outline and filled, and if you use these on overlapping text it draws an outlined or shaded stroke over the filled text. This is different than just an outline that strokes the text like -webkit-text-stroke-color would give you, since sometimes the filled font contains shading or other details.
Here's some examples of fonts designed to be used this way.
http://www.myfonts.com/fonts/matchandkerosene/duotone/
http://www.myfonts.com/fonts/scrowleyfonts/stomp/
I was sort of able to get this to work using CSS like this:
http://jsfiddle.net/6SakC/2/
This creates two H1 spans and uses the top-margin to move the outline one atop the filled one.
However, this doesn't seem ideal to me. Two problems:
I don't want to duplicate the text in the html.
I have to guesstimate the top-margin by trial and error.
If the text wraps, this doesn't work anymore.
Is there a better way to do this? I can live with having to duplicate the text, but I'd really like a more automatic way to do the positioning.
Thanks!
You can place the outline text inside the h1 and use absolute positioning instead of estimating the margin, as in this jsFiddle: http://jsfiddle.net/6SakC/4/
That also solves the problem with the text wrapping.
To avoid duplicating the text in the markup, you can use JavaScript to create the duplicate text, as in this jsFiddle: http://jsfiddle.net/6SakC/5/ (This might not be the best idea, though, since the text might get a moment to display without the outline, and JS is occasionally disabled in the browser settings.)

sifr: Opera-Bug: Flash Object too wide

I have used sifr to replace the fonts for headlines. It works fine in Firefox and IE.
http://design.speak-friend.com/
In Opera however, the headlines of the articles (object-tag within a-tag with-in h1-tag) get as wide as the used text is. If I limit the size of the object-tag via css, it just get's cut off (meaning some text is not displayed at all).
Is there any solution to this?
thanks
I had this same problem. I used jQuery to increase the size of the embeds by some set number of pixels, like +40px. I guess you could also grow them linearly, like by 120%.
I'm curious to see how other people solved this problem.
That's odd! I'm going to assume that Flash doesn't suddenly behave differently, so the problem is in reading out the width of the HTML element. I supposed you could try limiting the width of the main element you're replacing to see if that helps. Or perhaps place the text in a <span> and replace that?

Resources