2 Replies Latest reply on Nov 23, 2017 2:19 PM by medos20

    inherit field font from another field with JavaScript

    medos20 Level 1

      Hi,

       

      Please i want to know if there a way to inherit field font from another field (in Acrobat Pro DC) .. not just setting the font to the field, because i have full embedded font inside my form in Other language than english (Arabic) and i want the english text field to inherit font from another field  (Ar --> En) or Vise Versa, so the statment :

       

      this.getField("GenManagerAr").textFont

       

      maybe is not the perfect one to use!, any tips please ? thanks in advance

        • 1. Re: inherit field font from another field with JavaScript
          Thom Parker Adobe Community Professional

          Field fonts are always fully embedded (unless it is a type I font). Because any text could be placed in the field, the whole font is needed.  If you set another field to the same font, Acrobat will reference the font object for the first field. So for fields you never get duplicate font objects.

           

          The line of code below copies a reference for the font in "text1" into "text2", it does not duplicate the font.

           

          getField("Result2").textFont = getField("Result1").textFont;

           

          However, fonts for page text are handled differently from field fonts. First, they are almost always embedded subsets, not full font definitions. There is also a possible difference in how the character codes are handled between fields and content. Fields typically use 1 byte codes, whereas content is often 2 byte character codes.  For these reasons Acrobat doesn't mix Field fonts and Content fonts.

           

          That said, there is no reason why you couldn't write your own plug-in that modifies the fonts so that both content and fields share the same font definition.  In fact, it's possible that applications from Quite, Callas, or some other print oriented tool vendor already do this.

          • 2. Re: inherit field font from another field with JavaScript
            medos20 Level 1

            Thank you very much for your valuable information's!