Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » small-caps and pdf-/word-emitter
small-caps and pdf-/word-emitter [message #1027941] Wed, 27 March 2013 16:20 Go to next message
hage Mising name is currently offline hage Mising nameFriend
Messages: 67
Registered: September 2011
Member
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 #1028075 is a reply to message #1027941] Wed, 27 March 2013 20:10 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I do not think the textTransform property is supported, but you should be able to do the same thing with the format string property on the text/label item or use a style defined in BIRT.
Re: small-caps and pdf-/word-emitter [message #1028498 is a reply to message #1028075] Thu, 28 March 2013 10:35 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising nameFriend
Messages: 67
Registered: September 2011
Member
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 11:37 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising nameFriend
Messages: 67
Registered: September 2011
Member
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 #1029783 is a reply to message #1028535] Sat, 30 March 2013 05:52 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I thought you only wanted to upper case the data. I did not see the small-caps. I do not have a better work around for your issue.
Re: small-caps and pdf-/word-emitter [message #1061028 is a reply to message #1029783] Wed, 29 May 2013 14:59 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising nameFriend
Messages: 67
Registered: September 2011
Member
correct me if i'm wrong, but this document tells me i should be able to use the font-variant:small-caps style-sheet, shouldn't i?
Re: small-caps and pdf-/word-emitter [message #1061062 is a reply to message #1061028] Wed, 29 May 2013 17:30 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

That is a very old document and I believe that like Jason said above that some of those are not supported (never implemented into BIRT). You're saying you tried it and it didn't work, right? You could always submit an enhancement request in the bugzilla for it.

Michael

Developer Evangelist, Silanis
Re: small-caps and pdf-/word-emitter [message #1061159 is a reply to message #1061062] Thu, 30 May 2013 09:50 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising nameFriend
Messages: 67
Registered: September 2011
Member
Ok, never mind. Thx for your reply anyway. Gotta use that workaround described above.
Re: small-caps and pdf-/word-emitter [message #1061218 is a reply to message #1061159] Thu, 30 May 2013 14:55 Go to previous message
Jonathan Rodgers is currently offline Jonathan RodgersFriend
Messages: 11
Registered: May 2013
Junior Member
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(); });
}
Previous Topic:count of columns in fetched Dataset(dynamic report generation)
Next Topic:Does BIRT support cascade folders for design files
Goto Forum:
  


Current Time: Thu Aug 22 05:19:36 GMT 2019

Powered by FUDForum. Page generated in 0.02118 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top