[JS, ID5] Change fontStyle

Hello,
I have the following script for changing character overrides (bold) for character styles:
app.findTextPreferences = null;
app.changeTextPreferences = null;
app.findTextPreferences.fontStyle = "Bold";
app.changeTextPreferences.appliedCharacterStyle = "Bold";
app.documents.item(0).changeText();
The problem is that paragraph styles containing the font style "bold" as a preset, also get's the character style "bold" assigned.
The script has to skip the predefined -bold made- paragraph styles!?
Regards, Sjoerd

Hi Sjord,
Please try the below JS code, I have test the code in CS5.5 its working fine.
var myDoc = app.activeDocument;
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.fontStyle = "Bold";
var mySearch = myDoc.findText();
for(var i=mySearch.length-1; i>=0; i--){
    var myStyle = mySearch[i].appliedParagraphStyle;
    // Note: the below font style not in Bold then the script will apply the bold character style. If the heading has applied in Bold Condensed or something etc. This script will not work. Please take care.
    if(myStyle.fontStyle != "Bold"){
        mySearch[i].appliedCharacterStyle = myDoc.characterStyles.item("Bold");
thx,
csm_phil

Similar Messages

  • What happens when I back-save from ID5 to ID4?

    First, I am the person with ID5, on a PC using Windows 7 Pro.  I'm sending to a Mac that uses ID4, and don't know the operating system, maybe iOS 10?  I am hoping the ID version matters more.
    I am frustrated because I am sending articles to a small magazine that keep getting messed up by the graphic designer, who knows nothing about grammar, spelling, punctuation or layout.  Via Ctrl-E, I am then choosing .idml to back-save it so that the Mac can open the file.  I have no idea what is seen on the other end, so here are a bunch of questions:
    How much difference is there in letter kerning between ID4 and ID5?  (I suspect the other party is pressing Alt-left arrow to scrunch the letters closer together, which he doesn't have to do because I'm sending a laid-out article.)
    Do fonts I have that are not on the Mac carried over by a back-saved file?  Or does the Mac use a default font?  I used ITC Quorum, an Adobe font, which in print was transposed to Times Roman.  Plus, I put a "southwest shadow" behind the type in the font; the shadow appears in print at "northwest."  (I mean, come on: I'm duplicating what's on my new book's cover and they have to re-design it?!)  I have sent pages to my book editor via Ctrl-E and Adobe Print .pdf, and every time she's printed pages that have ITC Quorum, it comes through; there is no default.  My book editor has a Mac with OSX, and she doesn't own ID, so obviously there isn't a problem there.
    Finally, because of my frustration, I would like to know if there is a way to lock down everything in my article in such a way that the other party cannot format anything; his only option would be to copy and paste into the magazine whatever I send.  This would have to be a function well beyond Ctrl-L.  I am not getting any communication from this person and any time I challenge what's going on, I get blamed instead.  It's a very dysfunctional situation.
    In a couple weeks, I hope to meet in person with the person in charge about these issues, with hard copy in hand.  That person knows nothing about ID, and so it will help me to know what the other end gets when it comes to sending a back-saved .pdf.
    Many thanks in advance for anyone's thoughts.

    tman69 schrieb:
    Mr. Adelberger--the original poster said
    "I am frustrated because I am sending articles to a small magazine that keep getting messed up by the graphic designer, who knows nothing about grammar, spelling, punctuation or layout"
    69 I am able to read.
    tman69 schrieb:
    my advice is in relation to THAT! and judging by the OP's comments--the magazine appears to not have the newest version of INDD or even a decent RIP (hence the font replacement) additionally--they are opening his INDD file and changing it.
    Yes the changes you described can happen--but the original query was 'how to lock down everything'--that's what my recommendation is based on!
    You need not to have the newest version of InDesign to place an PDF/X-4 file. At least with CS2 you can place it, if not with 2.0 or CS.
    Converting to outline IS NOT locking down everything, it is destroying everything, and yes the described changes will happen.
    tman69 schrieb:
    Also--where I work--we never use Indesign to convert color space upon export--we use a rip profile to convert RGB to G7, but from the OP's description--the magazine in question, doesn't have a 'decent' rip.
    They have InDesign CS4, so they can handle  RGB PDF/X-4! So any profile conversion is possible on PDF EXPORT! But to avoid a CMYK-CMYK convertion it is better to use RGB images.
    tman69 schrieb:
    one more thing--you said "Embed fonts, that is enough!" last time I checked, you cannot embed fonts in an IDML file (which is what the original query was referring to)--however--perhaps the best solution is to just send a 'PDF'--but, I think the magazine in question is not using a PDF workflow (from what's described in the OP they are rotating pages in Indesign and do not have 'modern equipment)--so--I feel that your statement "Please don't make such dangerous recommendations!" is unfounded.
    Hey, I am not an idiot. I know that it is impossible to embed fonts in IDML. Fonts can only be embedded in a PDF and have to be embedded to get any PDF/X file.
    This magazine is using InDesign, so they are using PDF based programs. And when they work with InDesign, they need a rich PDF, so I recommend a PDF/X4. What else do you want to place? You cannot place any IDML file, you could place also an INDD file, but not from a future version.
    No, it is founded. With your recommendations a destroyed and changed file is delivered.

  • Cross-references slow ID5 down

    I'm using ID5 (7.0.2) on Win XP.
    I'm editing a 10 document book and as soon as I started cross-references the editing became unbearably slow - every character takes a second to update and hard drive is constantly in use.
    Performance is set to fast, live update disabled, hyphenation is off, etc. etc., but no luck.
    As a test, I copied one of the documents and deleted cross-references - the speed returned to normal even at high quality display and live redraw.
    Any ideas how to resolve the issue? Any chance of switching updating cross-references off? Any good advise is appreciated.
    An update: it seems that only cross-references that point to the external files cause the delay - I've got the impression that ID5 tries to open, update and close all the referenced files after every key stroke!
    As an addition test, I opened all referenced files at once and - voila! - almost no delay (only due to the immense usage of memory by the opened documents).
    I still would appreciate if anyone knows how to switch off dynamic cross-reference update.

    Dr Axly wrote:
    I'm using ID5 (7.0.2) on Win XP.
    I'm editing a 10 document book and as soon as I started cross-references the editing became unbearably slow - every character takes a second to update and hard drive is constantly in use.
    Performance is set to fast, live update disabled, hyphenation is off, etc. etc., but no luck.
    As a test, I copied one of the documents and deleted cross-references - the speed returned to normal even at high quality display and live redraw.
    Any ideas how to resolve the issue? Any chance of switching updating cross-references off? Any good advise is appreciated.
    Dr Axly wrote:
    I'm using ID5 (7.0.2) on Win XP.
    I'm editing a 10 document book and as soon as I started cross-references the editing became unbearably slow - every character takes a second to update and hard drive is constantly in use.
    Performance is set to fast, live update disabled, hyphenation is off, etc. etc., but no luck.
    As a test, I copied one of the documents and deleted cross-references - the speed returned to normal even at high quality display and live redraw.
    Any ideas how to resolve the issue? Any chance of switching updating cross-references off? Any good advise is appreciated.
    [EDIT] I saw your update. It's pretty clear that the trade-off is using memory to keep files open and gain speed, or saving memory and working slowly. Perhaps a compromise would be to open only those files referred to from the file you're editing? [/EDIT]
    Have you seen any improvement when you close the book and unused files, and edit one file at a time? I believe the changed x-refs should update when you reopen them and the book.
    If you are a very patient person, you can file a feature change request at https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform, and someday, perhaps, InDesign will offer the option to switch live x-ref updates off.
    If you're in a production-deadline situation, you may want to look at the commercial InDesign Cross-References Pro plug-in from dtptools.com. It can convert your existing InDesign x-refs to its own, quickly, and it has the option to turn live x-ref updates on/off.h
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices
    Message was edited by: peter at knowhowpro

  • Change the Text in Linked TFL on the fly

         I have 3 TFL fields on the stage. They are linked so the text overflow from the first spills into the subsequent fields 2 and 3. I want to change the text dynamically but when I do the overflow text do not "overflow" into the other fields. It is as if they were not linked at all.
    For instance, when I call:
    textField1.htmlText = "bla bla bla......" 
    the first text field displays the text just fine but the "overflow" does not display in textField2 and textField3 eventhough they are linked on the stage and the initial text displays just fine.
    Can this be done?
    \\Nick

    Do you mean TLFTextField in Flash pro? If you are talking about TextField, there is nothing about TLF.
    TextFlow can flow through linked containers. You can make it on linked Sprite. TLFTextField is a kind of Sprite. You need not to use TLFTextField to implement such a feature.
    Sample code:
        import flash.display.Sprite;
        import flashx.textLayout.compose.StandardFlowComposer;
        import flashx.textLayout.container.ContainerController;
        import flashx.textLayout.conversion.TextConverter;
        import flashx.textLayout.elements.TextFlow;
        import flashx.textLayout.edit.EditManager;
        import flashx.textLayout.container.ScrollPolicy;
        public class ContainerControllerExample1 extends Sprite
            private const textMarkup:String = "<flow:TextFlow xmlns:flow='http://ns.adobe.com/textLayout/2008' fontSize='8' " +
                    "textIndent='10' paragraphSpaceBefore='6' paddingTop='8' paddingLeft='8' paddingRight='8'>" +
                "<flow:p paragraphSpaceBefore='inherit'>" +
                    "<flow:span>There are many </flow:span>" +
                    "<flow:span fontStyle='italic'>such</flow:span>" +
                    "<flow:span> lime-kilns in that tract of country, for the purpose of burning the white" +
                        " marble which composes a large part of the substance of the hills. Some of them, built " +
                        "years ago, and long deserted, with weeds growing in the vacant round of the interior, " +
                        "which is open to the sky, and grass and wild-flowers rooting themselves into the chinks" +
                        "of the stones, look already like relics of antiquity, and may yet be overspread with the" +
                        " lichens of centuries to come. Others, where the lime-burner still feeds his daily and " +
                        "nightlong fire, afford points of interest to the wanderer among the hills, who seats " +
                        "himself on a log of wood or a fragment of marble, to hold a chat with the solitary man. " +
                        "It is a lonesome, and, when the character is inclined to thought, may be an intensely " +
                        "thoughtful occupation; as it proved in the case of Ethan Brand, who had mused to such " +
                        "strange purpose, in days gone by, while the fire in this very kiln was burning.</flow:span>" +
                "</flow:p>" +
                "<flow:p paragraphSpaceBefore='inherit'>" +
                    "<flow:span>" +
                        "The man who now watched the fire was of a different order, and troubled himself with no " +
                        "thoughts save the very few that were requisite to his business. At frequent intervals, " +
                        "he flung back the clashing weight of the iron door, and, turning his face from the " +
                        "insufferable glare, thrust in huge logs of oak, or stirred the immense brands with a " +
                        "long pole. Within the furnace were seen the curling and riotous flames, and the burning " +
                        "marble, almost molten with the intensity of heat; while without, the reflection of the " +
                        "fire quivered on the dark intricacy of the surrounding forest, and showed in the " +
                        "foreground a bright and ruddy little picture of the hut, the spring beside its door, the " +
                        "athletic and coal-begrimed figure of the lime-burner, and the halffrightened child, " +
                        "shrinking into the protection of his father's shadow. And when again the iron door was " +
                        "closed, then reappeared the tender light of the half-full moon, which vainly strove to" +
                        "trace out the indistinct shapes of the neighboring mountains; and, in the upper sky, " +
                        "there was a flitting congregation of clouds, still faintly tinged with the rosy sunset, " +
                        "though thus far down into the valley the sunshine had vanished long and long ago.</flow:span>" +
                "</flow:p>" +
            "</flow:TextFlow>";
            public function ContainerControllerExample1()
                // create the TextFlow, containers, and container controllers
                var textFlow:TextFlow;
                var container:Sprite = new Sprite();
                var container2:Sprite = new Sprite();
                var controllerOne:ContainerController = new ContainerController(container, 200, 210);
                var controllerTwo:ContainerController = new ContainerController(container2, 200, 220);
                // import the text flow from markup using TextConverter and assign a StandardFlowComposer
                textFlow = TextConverter.importToFlow(textMarkup, TextConverter.TEXT_LAYOUT_FORMAT);
                textFlow.flowComposer = new StandardFlowComposer();
                addChild(container);
                addChild(container2);
                container.x = 25;
                container.y = 100;
                container2.x = 280;
                container2.y = 100;   
                // add the controllers to the text flow and update them to display the text
                textFlow.flowComposer.addController(controllerOne);
                textFlow.flowComposer.addController(controllerTwo);
                textFlow.flowComposer.updateAllControllers();
                textFlow.interactionManager = new EditManager();
                //controllerTwo.verticalScrollPolicy = ScrollPolicy.ON;

  • How to change the color of label of af:inputText

    Hi,
    I want to change the color of label of <af:inputText> box . I used skinning for this , but this is not working.
    what i m doing is
    af|inputText::label{
    color:red;
    bt this is not working , please suggest me some way to do it...
    bt if i do this
    af|inputText::label{
    background-color:red;
    this is working.
    Thnx..

    Hi,
    You didn't mention Jdev version,anyway you can try as
    <af:panelLabelAndMessage label="Username" id="id"  labelStyle="background-color:red;">
      <af:inputText id="id5" value="Test"
                                  simple="true"/>
    </af:panelLabelAndMessage>See
    color change

  • Indesign 5 - Pdf export - Changing transparency opacity

    Just installed CS5.
    Its my first time in Indesign for CS5. I need to make some changes on an Indesign doc I created in CS4 and save to pdf. There is a background image that I have on every page of the doc... its set to opacity of 40%. Every time I try to save for pdf and then open the doc in Acrobat the background image appears to be setback to be 100% opacity. What's going on in 5 that is causing this? It doesn't do this in 4.

    I turned on overprint preview in Acrobat settings.
    Unfortunately it had no effect on the view.
    I think I traced the problem though.
    The background image was created from a logo created in Illustrator.
    I went back and re-copied the logo art from the same illustrator file, the exact same grouped set of vector art I orginally used, it still displayed the same problem in ID5 when exported.
    Then I copied a different vector logo from that illustrator file into ID5. It worked fine, saved to pdf and worked fine in Acrobat. I think there was something corrupt or weird with that specific vector grouping that ID5 did not like. So, I isolated the problem, but now I have to potentially change a bunch of files I made. Argggh.
    Thanks for you help.

  • StyleableTextField doesn't display fontWeight or fontStyle in iPad 3

    I have some LabelItemRenderers in my app that have a few StyleableTextFields in them:
    one to display a title in bold,
    one to display a bit of content and
    one to display a status in italics and another colour. 
    I apply the text stylings through setStyle() functions during the "set data" method as the heading style can slightly differ depending on data.  All fields use a system font.
    The different styles show up on iPad 1 correctly (and in the desktop emulator).  But, on iPad 3, the fontWeight and fontStyle settings don't render, but the text colour change does. 
    I've recently updated the AIR SDK to 3.3 and the problem still persists. 
    Dev info:
    Using FlashBuilder 4.6 Professional
    Flex SDK: 4.6
    AIR SDK: 3.3
    Builds done with ANT script using MXMLC for swf compilation
    Any ideas? 

    Finally had some time to try and trouble shoot this and figured it out.  As I am using a single code base for multiple project types (Mobile, Web and Desktop), my global CSS fontFamily declaration was a comma separated string. 
    Two factors I think were at play that made the styles fail to render on the mobile:
    1) Mobile apps can't use the comma separated string for fontFamily, only one entry can be used.
    2) The comma string names may have provoked the global style to use one of the embedded fonts that doesn't have bold or italics included.
    Whichever the reason, my solution was changing my default fontFamily for my mobile app to fontFamily: _sans; and styles now render correctly.

  • How to use character styles in the Find/Change JavaScripts?

    First, good luck to Ole. He's been so helpful (and such a good writer, too). All the best!
    My Find/Change JavaScripts are running into trouble at line 159 of the ExtendScript Toolkit. The script is searching for a particular font, to which it should then apply a character style. I'm using the format I see in Adobe's "FindChangeList" sample text, but the script is still hitting a wall. What am I doing wrong? I'd like to have a working method for searching, not only for fonts, but also for finding a particular character or paragraph style and then applying a new style.
    Simple stuff, but I'm roadblocked.
    Here is the script so far:
    //This script applies the DFKai character style to the Arial Unicode font.
    text {findWhat:"", appliedFont:"Arial Unicode MS", fontStyle:"Regular"} {appliedCharacterStyle:"DFKai"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find Unicode font; change to DFKai character style.
    Thanks for your help!
    Gary Niemeier

    You are absolutely correct. I don't know how those spaces got there! I copied the text from the "FindChangeList.txt" document, but somewhere along the way, a software program "helpfully" added the spaces. (Rest assured, it wasn't copied from AppleScript. I stick with JavaScript.) Anyway, the script now runs like a charm.
    My thanks to you! Another "newbie" mistake easily spotted, eh?
    One thing, though, if Adobe is reading this: please flesh out the "FindChangeList.txt" file for those who are not programmers/scripters. I'm just a normal InDesign user, and I really need examples of basic syntax in order to use the "Find/Change" script correctly. I'm referring to the syntax involved with finding or changing text with a certain character or paragraph style. I often search for styles, and those properties should be provided in the help file. A couple of samples are all that's needed. (I did read through the JavaScript reference guide provided by Adobe, and even in the "Find/Change" section, it did not provide this information!). Furthermore, I often search text for a specific font. Why isn't this syntax included as well? It would easy to do and would save users a lot of fumbling around.
    Thanks again, all the best.

  • Change font in Illustrator cs4 js

    I need to assign specific font to my text and it doesn't work. What am I doing wrong:
    var my_OUTSIDE_TextFrame = myInstrLayer.textFrames.add();
    my_OUTSIDE_TextFrame.geometricBounds = ["1.6 in", "1 in", "1.85 in", "2.75 in"];
    my_OUTSIDE_TextFrame.contents = "OUTSIDE";
    var myParagraph = my_OUTSIDE_TextFrame.paragraphs.item(0);
    try{
    myParagraph.appliedFont = app.fonts.item("Myriad Pro");
    catch(e){}
    try{
    myParagraph.fontStyle = "Bold";
    catch(e){}
    myParagraph.pointSize = 30;
    And it's not placing it where I want it either.
    Thank you very much for your help.
    Yulia

    Hi yulia,
    i maked some changes on your script:
    - what is it item(0) instruction ??
    use instead paragraphs[0]
    - moreover you can use fontStyle.. it doesn't exist , it's textFont.stye but only for read, you can't assign "bold" or other style...
    to put a differents style, you need to attribute when you call the font name "MyriadPro-Bold".
    (** to obtain exact name you need, i have attritube first manually, and check his name with myParagraph.characterAttributes.textFont.name, to be sure avoid error name OR use my second script below**)
    - you use paragraphs instruction, but i'm not sure that is really usefull, because you have created a text first and you can thus include your properties (font name and style) exept if you envisaged to change font before a paragraphs
    - what is it pointSize ? doesn't exist also.. simply use size if you want change the size of textFont
    For this remark, i recommande you to see this post
    now, below an updated of your script
    #target illustrator
    var doc=app.activeDocument;
    var myInstrLayer=doc.layers.add();
    var my_OUTSIDE_TextFrame = myInstrLayer.textFrames.add();
    my_OUTSIDE_TextFrame.geometricBounds = ["1.6 in", "1 in", "1.85 in", "2.75 in"];
    my_OUTSIDE_TextFrame.contents = "OUTSIDE";
    var myParagraph = my_OUTSIDE_TextFrame.paragraphs[0];
    try{
    myParagraph.characterAttributes.textFont=app.textFonts.getByName("MyriadPro-Bold");
    catch(e){alert(e)}
    myParagraph.characterAttributes.size = 30;
    Also for 1$ more* i can propose you (for CS4) the same with drop down list below:
    #target illustrator
    var doc=app.activeDocument;
    var myInstrLayer=doc.layers.add();
    var my_OUTSIDE_TextFrame = myInstrLayer.textFrames.add();
    my_OUTSIDE_TextFrame.geometricBounds = ["1.6 in", "1 in", "1.85 in", "2.75 in"];
    my_OUTSIDE_TextFrame.contents = "OUTSIDE";
    var myParagraph = my_OUTSIDE_TextFrame.paragraphs[0];
    try{
    var ressource="dialog { text: 'Font List'}";
    var item=new Array();
    var dlg=new Window(ressource);
    var dd=dlg.add('dropdownlist',undefined);
    for( j=app.textFonts.length-1;j>-1;j--){dd.add('item',app.textFonts[j].name); }    
    dlg.btnRND=dlg.add('button',undefined,'Choose this font.',{name:'ok'});
    dlg.btnCANCEL=dlg.add('button',undefined,'Cancel',{name:'cancel'});
    dlg.show();
    for (k=dd.items.length-1;k>-1;k--){
    if (dd.items[k].selected){myParagraph.characterAttributes.textFont=app.textFonts.getByName(dd.items[k])}    
    catch(e){alert(e)}
    myParagraph.characterAttributes.size = 30;
    See you, art.chrome
    * this is a joke, i didn't ask for money !

  • Specified font need to be changed in all paragraph styles

    Hi All,
    Is there any option to change a font which is used in many paragarph styles to some other font.
    Thanks in advance,

    ok.. this should work for most cases:
    function main(){
              var doc=app.activeDocument;
              var myDialog= new Window("dialog","Font replacer");
              var grp1=myDialog.add("group");
              var panel1=grp1.add("panel",undefined,"Find font:");
              var panel2=grp1.add("panel",undefined,"Change font:");
              var findFonts=doc.fonts.everyItem().name.join("\r").replace(/\t/g,":").split("\r");
              var chFonts=app.fonts.everyItem().name.join("\r").replace(/\t/g,":").split("\r");
              var myFindDrop=panel1.add("dropdownlist",undefined,findFonts);
              var myChDrop=panel2.add("dropdownlist",undefined,chFonts);
              myDialog.add("button",undefined,"Ok",{name:"ok"});
              myDialog.add("button",undefined,"Cancel",{name:"cancel"});
              myFindDrop.selection=myFindDrop.items[0];
              myChDrop.selection=myChDrop.items[0];
              if (myDialog.show()) {
                        var pstyles = doc.allParagraphStyles;
                        var cstyles = doc.allCharacterStyles;
                        var ffont = myFindDrop.selection.text.replace(/:/g,"\t");
                        var tfont = myChDrop.selection.text.replace(/:/g,"\t");
                        for (var a = 1; a < pstyles.length; a++) {
                                  if (pstyles[a].appliedFont.name==ffont) {
                                            pstyles[a].appliedFont = tfont;
                        for (var i = 1; i < cstyles.length; i++) {
                                  if ((cstyles[i].appliedFont+'\t'+cstyles[i].fontStyle==ffont)||(cstyles[i].appliedFont.name==ffont)) {
                                            cstyles[i].appliedFont = tfont;
    }app.doScript("main()",undefined,undefined,UndoModes.fastEntireScript,'Global Change Font');
    When i'll have the time i'll probably do a more advanced version, to change font families or just font variants etc.
    However, for your example, it won't change the character style "three". I'm curious about how did you defined that style because while in the interface it shows that the applied font is "Minion Pro" and the font style is "Regular", when i get the font Style property from the script it reports as "Roman". Very very wierd.

  • (CS4) How to change text in character format?

    Hello scripters,
    I need help for a problem with "FindChangeByList":
    I want to change text with special elements (and more than one element),
    for example: color:black AND italic AND subscript
    (or elevated, capital, small caps)
    and change it in a character format  that i have defineted before
    (lets call it for example "01-xyz").
    As i understand it, i can make it with the "FindChangeByList-sript" and GREP
    But what must stand here "?"
    grep {find what:"?"} {change to:"?"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find all double spaces and replace with single spaces.
    Can anybody help me, please?
    Yours Oliente

    Sorry,
    only now i get to try the element i got with the new script (at the end of the FindChangeList).
    But i must have make a mistake:
    text {findWhat:appliedFont:"Minion Pro", fontStyle:"Italic"} {changeTo:appliedFont:"Minion Pro", fontStyle:"Bold"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    It says
    Fehler Nummer 25 (Mistake nr 25)
    and than show me the line i have written.
    It is the same with all elements.
    Can someone help me?
    Yours Oliente

  • Cannot use styleName and fontStyle property together in Label?

    Hi All,
    I am using Label component with the following attributes set,
    see code 1)
    but in my CSS I defined the style myStyle as below see code
    2)
    Here I am trying to use embed a font and use the style in the
    Label.
    I want the other styles to be given seperately like italic
    and bold using "fontStyle" and "fontWeight" properties of a Label.
    see code 3)
    The problem here is that,
    If I introduce any of these "myStyle" is not working. I mean
    that the font which I embeded is not implemented. Its taking its
    own default font. But If I remove fontStyle and fontWeight
    "myStyle" is working properly.
    I hope I had made my problem clear.
    Any help would be appreciated.
    Thanks.

    "COKFlex" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi Amy and Greg, Thanks for your replies.
    >
    > Yes I knew that I can use the fontstyle and fontwidth in
    my CSS. Before I
    > proceed next, let me explain you about my requirements
    and why I am using
    > embedded fonts.
    >
    > My requirement is to have all the font related styles as
    configurable from
    > an
    > Xml file like .
    >
    > <Text>
    > <Forecolor>#FFFFFF</Forecolor>
    > <Backcolor>#000000</Backcolor>
    > <Fontname>TimesNewRoman</Fontname>
    > <Fontsize>30</Fontsize>
    > <Fontstyle>normal</Fontstyle>
    > <Fontweight>normal</Fontweight>
    > </Text>
    >
    > Which I can read at run time and apply the styles.
    >
    > Ok Now I am coming to the need to using embedded fonts.
    If I didnt embed
    > the
    > fonts the text displayed in my application are not
    smooth. But its smooth
    > if I
    > use embedded fonts. {It is possible if we install the
    fonts from the
    > Windows CD
    > [Control Panel->Regional Language and
    Setting->Language Tab->Supplementary
    > Language support] options>} But I observed that few
    system doesnt have
    > that
    > installations. So the fonts which I am trying to use in
    the configuration
    > xml,
    > even though the system has that font, its not appearing
    smoothly in my
    > application.
    >
    > ok, so next I decide how I make the embedded fonts as
    configurable. I gave
    > the
    > fontname as the stylename and give that stylename in the
    configuration xml
    > as I
    > mentioned in my previous post.
    >
    > And I implemented that using styleName="<value read
    from the config xml>"
    > which inturn refers the stylename I used in the CSS for
    the embedded font.
    >
    > As I mentioned earlier, all the styles I want it to be
    configured, I
    > cannot
    > give italic or bold in the CSS style instead it has to
    be read from my
    > config
    > XML.
    >
    > So I decided to use the fontStyle and fontWeight
    properties of the Label.
    > So
    > then the problem comes, if I use stylename and fontstyle
    together,
    > fontStyle is
    > actually overriding the styleName's embedded font and
    applying style as
    > italic
    > but not with the embedded font which ultimately results
    in not giving me a
    > smoother display.
    You can actually change the CSS declaration itself. But I
    think you will
    also need to embed the other forms of the font if you want to
    use them.
    HTH;
    Amy

  • How to programmically change all fonts in Crystal Reports using VS2005

    Post Author: KonRi
    CA Forum: .NET
    I want to change all fonts in my rpt files from Arial to Tahoma. I have:
    ReportDocument report;
    raport.Load(fInfos&#91;i&#93;.FullName);
    if (report.IsLoaded)    ChangeFont(report, path);
    ...        private void ChangeFont(ReportDocument oReport, string path)        {            foreach (CrystalDecisions.CrystalReports.Engine.Section crSection in oReport.ReportDefinition.Sections)            {                                foreach (CrystalDecisions.CrystalReports.Engine.ReportObject crObject in crSection.ReportObjects)                {                    FontStyle fStyle = FontStyle.Regular;                    if (crObject.Kind == ReportObjectKind.TextObject)                    {                                                CrystalDecisions.CrystalReports.Engine.TextObject text = (CrystalDecisions.CrystalReports.Engine.TextObject)crObject;                        if(text!=null)                        {                            if (text.Font.Bold)                                fStyle = fStyle | FontStyle.Bold;                            if (text.Font.Italic)                                fStyle = fStyle | FontStyle.Italic;                            if (text.Font.Underline)                                fStyle = fStyle | FontStyle.Underline;                            if (text.Font.Strikeout)                                fStyle = fStyle | FontStyle.Strikeout;                            text.ApplyFont(new Font("Tahoma", text.Font.Size,fStyle));                                                    }                    }                                        else if (crObject.Kind == ReportObjectKind.FieldObject)                    {                       ... the same                    }                    else if (crObject.Kind == ReportObjectKind.FieldHeadingObject)                    {                        ... the same                    }                                        else if (crObject.Kind == ReportObjectKind.SubreportObject)                    {                        CrystalDecisions.CrystalReports.Engine.SubreportObject crSubReport = (CrystalDecisions.CrystalReports.Engine.SubreportObject)crObject;                        ReportDocument crSubDoc = crSubReport.OpenSubreport(crSubReport.SubreportName);                        ChangeFont(crSubDoc,path);                    }                }            }            if (!oReport.IsSubreport)                oReport.SaveAs(path);        }
    This works fine but when TextObject has Embedded Fields those Fields aren't change and still have Arial font.My question is: how to change font in whole rpt file, including Embedded Fields?? RegardsKonRi

    Is there any update on this ? I am facing the same problem.
    Thanks

  • Find /change batch in InDesign CS5

    I understand that scripts can be written to batch find/change. I see where the file is under utilities and I'm sure it's very simple to someone familiar with scripting, but I'm not a programmer so was wondering if someone would write thi
    s for me. I need to find two spaces and replace with one;
    find two periods and replace with one; find 1/4 and replace with ALT+0188; find "-ALT+188" and replace with ALT+0188
    ; find 1/2 and replace with ALT+0189; find "-ALT+189" and replace with ALT+0189; find 3/4 and replace with ALT+1090; find "-ALT+190" and replace with ALT+0190; find ".net."and replace with .net; find ".com" and replace with .com; find ".org." and replace with .org; find paragraph style "Boxed Ad" and replace with "Classified"; find format Helvetica, Bold, Center and replace with paragraph style "Bold Center".
    I'm very grateful to anyone who can help!

    This is required very minimal scripting knowledge.
    Open all document required to find change stuff and run below javascript code
                var ReplaceArray = [["  ", " "], ["..", "."], ["1/4", "ALT+0188"], ["1/2", "ALT+0189"],
                                                ["-ALT+188", "ALT+0188"], ["-ALT+189", "ALT+189"], ["3/4", "ALT+1090"], ["-ALT+190", "ALT+0190"],
                                                [".net.", ".net;"], [".com", ".com;"], [".org.", ".org;"]];
                for(j=0; j<ReplaceArray.length; j++)
                    var curArray = ReplaceArray[j];
                    ChangeInStory(curArray[0],  curArray[1])
    function ChangeInStory(find_text, change_text, findType){
        try{
            app.findTextPreferences = app.changeTextPreferences = null;
            app.findChangeTextOptions.wholeWord = false;
            app.findChangeTextOptions.caseSensitive = true;
            app.findTextPreferences.findWhat= find_text;
            app.changeTextPreferences.changeTo = change_text;
            app.changeText();
            app.findTextPreferences = app.changeTextPreferences = null;
        catch(e)
                throw (e);
            try
            app.findTextPreferences = app.changeTextPreferences = null;
            app.findTextPreferences.appliedParagraphStyle= "Boxed Ad";
            app.changeTextPreferences.appliedParagraphStyle = "Classified";
            app.changeText();
            app.findTextPreferences = app.changeTextPreferences = null;
        catch(e){
                throw (e);
           try
            app.findTextPreferences = app.changeTextPreferences = null;
            app.findTextPreferences.appliedFont= "Helvetica LT Std";
            app.findTextPreferences.fontStyle= "Bold Condensed";
            app.findTextPreferences.characterAlignment= CharacterAlignment.ALIGN_EM_CENTER;
            app.changeTextPreferences.appliedParagraphStyle = "Bold Center";
            app.changeText();
            app.findTextPreferences = app.changeTextPreferences = null;
        catch(e){
                throw (e);

  • TextInput change text on click

    Hello all.
    I have a text input that has the text "Name".  What i want to do, is when this is clicked it gets rid of this text.  I can do it this way
    <s:TextInput x="10" y="291" width="265" textDecoration="none" text="Name" id="txt_name" click="txt_name.text=''" fontStyle="italic"/>
    Simply changing the value of text to "" on the click attribute.
    However this causes problems because if you click it once it gets rid of "Name" and then you type in something, if you clicked it again it would get rid of what you typed in.
    So i though about this simple function
                protected function commentnametext():void
                    if (txt_name2.text == 'Name')
                        txt_name2.text == '';
                    else
    <s:TextInput x="10" y="321" width="265" textDecoration="none" text="Name" id="txt_name2" click="commentnametext()" fontStyle="italic"/>
    However when i click the textarea it dosent seem to run the function, the text dosent change.  Any ideas why its not working?

    Your function is wrong
    protected function commentnametext():void
                    if (txt_name2.text == 'Name')
                      txt_name2.text == '';  --- you have to write here txt_name2.text=''; instead of 2 == write only 1 =
                    else
    If this post answers your question or helps, please kindly mark it as such.

Maybe you are looking for