Change the font style in a paragraph Style

I have a code which changes the font of my paragraph style, but I also need to change the font style. I have the following code and the applied font style line is to throw an error.

myStyle = app.activeDocument.paragraphStyleGroups.item("Headings").paragraphStyles.item("Heading 1");
myStyle.appliedFont = "Microsoft JhengHei";
myStyle.appliedFontStyle = "Bold";

The code works without the last line in, but when he is in I get this error:

Window Capture.png

I looked on the site Jongware under Font Style:

http://jongware.mit.edu/idcsjs5.5/pc_ParagraphStyle.html

RichardM0701 wrote:

As in the model DOM is misleading or my code is wrong?

Surely not! (This first one, by the way.) Check this page of DOM; ther eis no such thing as "appliedFontStyle" for paragraphs.

You can give a more his style associated with an object police do (what you must look first), or as a string, but the string must have a special format:

"family style [tab]".

and since this is Javascript, you must type the tab as '\t ': character

myStyle.appliedFont = "Microsoft JhengHei\tBold";

(You also must be sure that this police more combo style actually exists, or well ID will always throw an error.)

This 'trick' is not in the presentation of the DOM commands, because (uh) Adobe don't think to mention. But you should not use the command for the basic syntax reference, for that you need to read Adobe's Javascript Programming Guide, and I'm sure he gets mentioned in there.

Tags: InDesign

Similar Questions

  • Changing the font styles in the table of contents usingpages 5.6.2

    Hello

    I am writing a scientific assignment and I have some titles that contain italic characters such as: Importance of Bacillus cereus

    When I create a table of contents, these italics seem to disappear and I can't do these italics without making the entire table italic material - that is not what I want.

    I also have the same problem with the degrees symbol which is great script in my titles, but appears as '0' in the table of contents.

    Can anyone help please?

    Thank you!

    When you build a Table of contents, Pages v5.6.2 uses a brush regular Helvetica on all text in the generated TOC. He made his farewell to all the attributes of fonts can set up for your titles and headings. We can not selectively reapply text attributes to a part of a table of contents entry.

    If I use the degree symbol in the title or the title paragraph style, she survives as baseline Exhibitor in the generated table of contents. My degree symbol is entered as shift + option + 8 (on a U.S. keyboard).

  • Change the font in the Style Script of paragraph?

    Does anyone know if there is a script to go through paragraph Styles and change the font of the other?

    Also, when it is to reduce the size of police/leader at the same time, or in two separate scripts, which would be sweet utra.

    Thanks to all those who can help in advance.

    littlemookie

    I don't know if there's a script to do this, so one here that I just did to the top. This is assuming you are using CS3 (you don't mention a version), and there are small differences between the versions of ID, so he can't run right now.

    for (var i = 2; I have
    {
    app.activeDocument.paragraphStyles [i] .appliedFont = "Helvetica";
    app.activeDocument.paragraphStyles [i] .pointSize * = 0.80;

    If (app.activeDocument.paragraphStyles [i] .leading! = Leading.AUTO)
    app.activeDocument.paragraphStyles [i] .leading * = 0.80;
    }

    "It ignores the 2 first paragraph styles because those who are"[none]"and [standard paragraph]", and apparently, it's bad karma to mess with those.

    The first line inside the loop simply sets the font. An additional style specifier (for example, 'Normal', 'Bold') is left out because you have something already there. Notice that if you try to change "Helvetica-Bold" for, say, a Frutiger, it will not be correct first time round - Frutiger is not "" BOLD"," it's called "" 65 BOLD"" for this family. Well, you can't all win'em.

    The second line takes the current set point size and multiplies it with 0.80, resulting in a new size of 80% of the previous.

    Lines possible 3rd & 4th first test for a complication. If your leader is set to automatic, you don't have to make it smaller (even worse: JavaScript code tries to multiply Leading.AUTO 0.80 and will be the bomb out with an error). Only when the value to a value fixed, it will reduce to 80%.

  • divide the extrusion - and then change the source (such as the font style)

    Hello

    My friend bought the Photoshop CS6 extended and we try to solve something in the 3D environment:

    We did an extrusion "divided" on the text so that we can change a few colors on letters to one and rest another color.
    Then I thought I want to change the font, then I must be able to change the source.

    1. How can I change source when a text is "split extrusion.

    2. is there a way for me to merge the split one and keep my changes of color on the individual letters? How do then?

    Best regards
    NISSE

    Simply, it does not work like that. When you split the extruding you create persistent meshes that can not be edited any more nor the source of the mesh can be changed. You will have to start from scratch.

    Mylenium

  • Why is-inbrowser editing to change my fonts styles?

    When I try to change the text in my MUSE using InBrowserEditing site, my fonts change to arial, the police gets smaller, and line spacing decreases so the text looks completely different from the original formatting. I use the fonts based on the web and paragraph styling then why is the Publisher to change my fonts styles? If I sell this to my client so that they must be able to do their own editing, font styles must stay the same that I designed the. Otherwise, it won't work.

    Please try these options:

    -If you add text in a text block, it must have the same style as the text immediately preceding text frame without deleting the text with a space

    -If you replace text, select all and then start typing your new content - does not hit the DELETE key in the meantime

    -Add your news and then delete old content

    I would like to know how this happens.

    Thank you

    Sanjit

  • How you set the font style and size as the norm for the e-mail that is sent and received?

    I, too, have this problem. Am using Outlook.

    Separated from -.

    https://answers.Microsoft.com/en-us/Windows/Forum/windows_8-desktop/how-do-you-set-the-font-style-and-size-as-the/d48a95c5-68a1-4766-873d-d9924004feab

    Outlook policies can be changed in options.

    1. On the file menu, click Options
    2. Go to the mail section, and then click stationary and fonts
    3. Choose your fonts

  • change the line style for cell None

    Hi expert,

    How to change the line style for cell to zero.

    Respect of

    John

    my_cell.topEdgeStrokeColor = app.activeDocument.swatches.item("None");
    my_cell.leftEdgeStrokeColor = app.activeDocument.swatches.item("None");
    my_cell.bottomEdgeStrokeColor = app.activeDocument.swatches.item("None");
    my_cell.rightEdgeStrokeColor = app.activeDocument.swatches.item("None");
    

    Do not test, but should work.

  • How to change the border style of the list items in the apex


    Hi all

    We have created a few items from the selection list in the Apex and ask users to make changes to the border.

    I tried many ways, but he was not able to make changes, some could help me how we can change the border style of list items in Apex. By, the approach has been used by us

    Attributes of the element in the HTML form -> style = "" border: 1px solid #E5E4E2; "" [I speak that way] but no luck.

    Kind regards

    Sheikh tayeb.

    SruthiTamiri wrote:

    Hello

    Please find the details below

    APEX version # 3.2

    Internet Explorer version #7

    Mozilla version 12.0.

    Used theme #Blue

    Topic identification number is #12

    It is not possible to change the appearance of the borders of the selection list in IE7.

    To the borders of all the elements of the selection list style on a page in other browsers, include the following style sheet in the HTML Header page:

    .formlayout select {
      border: 1px solid #E5E4E2;
    }
    

    APEX 3.2 is no longer supported, and IE7 is obsolete. Upgrade to the current version is recommended.

  • detect the font style in the text field

    Hello. I wonder if there is a way (in AS3) to detect the font style of the text in the field of dynamic text (via PHP).

    Any ideas?

    Concerning

    It is unclear what you intend when you say style, but you can use the textfield getTextFormat() method to determine the different properties of the text.  If you have a TextField with a 'tf' instance name, you can use the following out of the police...

    trace (TF.getTextFormat (0) .say);

  • How can I change the font color? I have no option "color" under "format".

    How can I change the font color? I have no option "color" under "format".

    Hello

    There are several ways to do this-

    1. for font color, you can use the CSS section in the Inspector (Windows-> property) properties.

    2. you can set the style inline in Code view (for example it is paragraph

    3. you can use CSSD to add a switch and set color property in the section of text.

    Thank you!

    Kusha

  • Possibility to change the fonts of the text variables in the headers?

    I want to change the appearance of text variables in my head. I have my name of document and other variables in my head, but I would like to change the fonts. Is this possible?

    A variable is treated as a single character, so it can be decorated using the paragraph style or a character style, or if you want to get clever, you can use a nested character style or GREP style in the paragraph style.

    I think you're ready to buy a good book. Sandee Cohen's quick start guide is a resource of great beginner, and I think you are advanced enough that Real World InDesign can be a good investment.

  • How can I increase the size of the font of a single paragraph?

    I use Dreamweaver CS4. I want to increase the font size and style of a single paragraph, but the "page properties" changes the font size for the entire page. In this regard: How can I increase the font size (and style) for a single word. Thank you very much, Mr. Monroe

    quest for clear code wrote:

    Choose 'new style inline' in the target rule drop. That the new etc color/size/placement of Brown.

    Using the styles inline is a very bad habit, except in rare circumstances, such as the creation of an HTML email. Inline styles added the rule of style directly in the HTML, you will have to change every single instance if you ever want to change the way the text appears.

    It is best to select the text and make sure that the rule field target poster . Give a class name when you are prompted to the rule. You can then use the menu rule target or a category to apply the same style to any text. Changing the properties of the rule in one place then affects all of the text that uses the same class.

  • Change the font back sentences in the HTML area.

    Hello

    I have a problem on the subject to change the font of the sentences back in the HTML area.

    I tried using the 'font' and 'size' in the HTML area. But it does not work. The police of "This is a paragraph", does not change regardless of any size.

    Help, please.

    Published by: user10458244 on October 22, 2008 02:49

    < span style = "do-size: 15px" > This is a paragraph </span >

    should do the job.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • How to change the font to 'request' a font sets for an entire façade

    Hello together,

    normally all my frontpanels use the apllication font. Now, we have mixed operating systems. Some are still using windows xp, the other windows 7. In windows 7, the standard application font has changed. Under my programs under windows 7 results in ugly frontpanels, according to the new standard application font.

    Y at - it an easy way to set the font for an entire façade. I don't want to score every text and change the font type.

    Thank you very much greetings,.

    Michael

    Press Ctrl + A (select all) and change the font. All the fonts selected style will arise.

  • Change the fonts icon in Windows 7

    In Windows 7, the names of the icons appear in a font that is white with a black shadow around the characters.  This became boring with my background color.  I want set the font style for a solid as plain Tahoma font.   How change and change the fonts that appear in the names of the icons and shortcuts?

    You can change the type of font (Tahoma, Segoe UI, Ariel, Times New Roman, etc) in the section Customizing the control panel.  Choose the color of the window options, and then use the link options aspect advanced to access fonts.

    To get rid of the black shadow, type Word appearance in the start menu, then choose "change the appearance and performance of windows."  In the list, you can disable the option "use shadows for icons on the desktop" (near the bottom of the list).

    If it solves your problem, click on the link "Propose as answer" below and vote as useful by clicking on the green triangle for the lelft. Thank you!

Maybe you are looking for

  • Volume icon does not

    I have a brand new Acer Aspire V3 - 572G. Its been a little lemon so far, but I'll give the benefit of the doubt for just a little longer I'm not particularly tech-savvy then maybe the problem is me. Yesterday the volume (on the bar at the bottom of

  • How can I get or create a windows vista recovery disc? My system restore does not work!

    Attempted to purchase the HP recovery Dics... Has said that Vista is obsolete!

  • Updates Windows 7 July

    I'm having a problem when searching for July 2016 updates windows 7 64 bit.  Control Panel > updates > the bar does not stop looking.  I've done three times.  Even when I close out of it, 10 minutes later I went back and she is still ongoing.  After

  • Removal of Extended Partition

    I'm unable to reduce an extended partition in order to enlarge a primary partition (drive C). So I want to remove the extended partition and its unallocated space after the removal of several logical volumes. After developing my C drive, I re-create

  • Inspiron 1300 CD/DVD failure

    Hi, when I tried to update to a newer PHILLIPS CDRW/DVD SCB5265TD15 firmware and I run the EXE, but my computer got freeze and restart when he and I tried to open the CD/DVD drive, but it does not open. Without a flashlight on the disc when suppose t