small-caps and pdf-/word-emitter [message #1027941] |
Wed, 27 March 2013 12:20  |
Eclipse User |
|
|
|
Hi,
i have defined a style like this
<style name="Caplizer" id="3592">
<property name="fontFamily">"Arial", sans-serif</property>
<property name="fontSize">16pt</property>
<property name="fontWeight">bold</property>
<property name="color">#003366</property>
<property name="textTransform">capitalize</property>
</style>
A simple textlabel in my report references (uses) this style. Generating html output, the text appears in small-caps, generating pdf / word output the label seems to ignore that textTransform property. Is that a known issue?
thx in advance,
hage
|
|
|
|
Re: small-caps and pdf-/word-emitter [message #1028498 is a reply to message #1028075] |
Thu, 28 March 2013 06:35   |
Eclipse User |
|
|
|
thx for your reply jason.
what do you mean by "not supported"? textTransform works for html-output only?
i also tried adding a style via a css file like this:
font-variant:small-caps;
font-family:Arial, sans-serif;
font-size:12pt;
font-weight:bold;
line-height:1.15;
text-transform:capitalize;
variant and/or text-transform are the only two properties that are obv. beeing ignored (producing a non-html ouput).
Regarding your advice, i can't see a "Format String"-Property for Text/Label within the PropertyEditor of such an element. Which way do i access them, and how does the expression to format to small-caps has to look like? I don't wan't uppercase, first char of the string should be larger than the rest of the string if it was an uppercase one i had a string like
Ulll
with U being Uppercase char and l representing a lowercase char. Since this is a font rendering issue (or isn't it?) i can't see a way resolving that issue with the format string property, correct me if i'm wrong here.
thx in advance,
hage
(btw: nevertheless, word/oo/pdf are able to display capitalized / small-caps strings in general on my system, and additional info, i'm using birt 3.7.0 )
addition: searching my plugins folder i discovered a feature org.eclipse.birt.report.engine.fonts containing some fontConfig_xyz.xml files. Are these the only fonts, the engine is able to render? Perhaps i'm able to solve my problem, adding some "capitalizeable" fonts in here?
|
|
|
Re: small-caps and pdf-/word-emitter [message #1028535 is a reply to message #1028498] |
Thu, 28 March 2013 07:37   |
Eclipse User |
|
|
|
i found a dirty workaround, using a dynamic textfield with the following script on its "onRender"-event:
importPackage(Packages.java.lang);
sb = new StringBuilder();
sb.append("<span style=\"font-family:arial, sans-serif; text-align:left line-height:1.15; margin-top:12pt, margin-bottom:12pt; color:#003366; font-size:24pt\">S<span>");
sb.append("<span style=\"font-family:arial, sans-serif; text-align:left line-height:1.15; margin-top:12pt, margin-bottom:12pt; color:#003366; font-size:20pt\">MALLCAPS<span>");
this.text = sb.toString();
very dirty, but at least it does the trick. But, the two spans are not based on one line, the "S" should only be larger as the "MALLCAPS" in one direction (above), not in both. Don't know if it's possible to manage that with style properties, i'll keep tryin, but a "programmatic" solution would be nicer/better anyways.
|
|
|
|
|
|
|
Re: small-caps and pdf-/word-emitter [message #1061218 is a reply to message #1061159] |
Thu, 30 May 2013 10:55  |
Eclipse User |
|
|
|
I have been running into a similar issue and thought I would contribute. I took a slightly different since I needed the ability to apply SmallCaps to dynamictext items as well as textitems I made use of a script function containing a simple regex. The function and regex could be alot better to handle incorrect capitalization but works for my needs. For TextItem <VALUE-OF>toTitleCase("RANDOM text")</VALUE-OF> or in DynamicTextItem toTitleCase("RANDOM text"); both displaying Random Text.
I put the following function in the report Script: initialize
function toTitleCase(str)
{
return str.toLowerCase().replace(/^(.)|\s(.)|-(.)/g, function(txt) { return txt.toUpperCase(); });
}
|
|
|
Powered by
FUDForum. Page generated in 0.25478 seconds