5 Replies Latest reply on Dec 16, 2014 2:19 PM by edilmar

    Fonts for outputText changed after upgrade javax.faces.jar from 2.1.6 to new 2.1.29

    edilmar

      My environment is: NetBeans 8.0.1 + Glassfish 3.1.2.2 + JSF 2.1 + Richfaces 4.3.7 + CDI/Weld 1.1.8 (original) + Apache CODI 1.0.6 + JPA 2 + Hibernate 4.2.7 + RDBMS Firebird 2.5.2 + JasperReports 5.5.

      Yesterday, I started tests after changing the original javax.faces.jar 2.1.6 that comes with Glassfish to the new 2.1.29 downloaded.

      Then, the h:outputText labels from my webapp becames bigger.
      All other components become exactly the same size.

      Below sample attachments from the "old 2.1.6 page" and "new 2.1.29 page" in Firefox 33 and Chrome 39. Same behaviour in IE too.
      Using Chrome, the difference in outputText is more visible.
      The only change in my project was javax.faces.jar file.


      JSF-Firefox-OutputText.jpg


      JSF-Chrome-OutputText.jpg

      I dont know if this is a bug in JSF 2.1.6 that doesn't recognize the font configuration from the browser and uses the configuration defined in my css file:


      
      body {  
          background-color: #ffffff;  
          font-size: 12px;  
          font-family: Verdana, "Verdana CE",  Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif;  
          color: #000000;    
          margin: 10px;  
      
      }
      


      or newer versions of JSF uses the configuration from the browser and ignores the configuration defined in my css file.

        • 1. Re: Fonts for outputText changed after upgrade javax.faces.jar from 2.1.6 to new 2.1.29
          michpetrov

          The browser will tell you where does the CSS come from and if it's being overwritten; it's possible something changed with resource handling.

          • 2. Re: Fonts for outputText changed after upgrade javax.faces.jar from 2.1.6 to new 2.1.29
            edilmar

            Behaviour of formatting outputTexts:

            - JSF 2.1.6: if I don't define a CSS style, it uses some internal default font size and not the font size from my "CSS body" general config

            - JSF 2.1.29: if I don't define a CSS style, it uses the browser default font size and not the font size from my "CSS body" general config

            Then, I was happy with internal font size from 2.1.6 that allowed the same layout at all browsers.

            Now, with 2.1.29 I will have to configure a CSS style class at all outputTexts to ensure the same layout at all browsers.

            • 3. Re: Fonts for outputText changed after upgrade javax.faces.jar from 2.1.6 to new 2.1.29
              edilmar

              Again... I made two tests:
              1) creating a xhtml without Richfaces
              2) creating a xhtml with Richfaces but without any Richfaces component
              3) creating a xhtml with Richfaces like page above that uses many components with their CSS layouts

              I created the outputText without style class, to use the default style defined.

              - 2.1.6: same behaviour in 1), 2), 3)
              - 2.1.29:
              ===> 1) uses my "CSS body" font config
              ===> 2) uses my "CSS body" font config
              ===> 3) uses browser default font config => this case I have to force a CSS style for all outputTexts, I think there is some CSS layout from Richfaces components that changes the default config and causes confusion for all the layout.


              For example, I have a outputText into a rich:panel. I used Firebug to check the CSS layout aplied by default from it, and it is .rf-p-b that uses font-size 11px in 2.1.6 (<div id="formcidadeFil:panelcidadeFil_body" class="rf-p-b ">) but in 2.1.29 the browser (Chrome and Firefox) used its default font-size 14px (or other bigger or smaller if I change it).

              • 4. Re: Fonts for outputText changed after upgrade javax.faces.jar from 2.1.6 to new 2.1.29
                michpetrov

                Edilmar Alves wrote:

                 

                ..

                For example, I have a outputText into a rich:panel. I used Firebug to check the CSS layout aplied by default from it, and it is .rf-p-b that uses font-size 11px in 2.1.6 (<div id="formcidadeFil:panelcidadeFil_body" class="rf-p-b ">) but in 2.1.29 the browser (Chrome and Firefox) used its default font-size 14px (or other bigger or smaller if I change it).

                That looks like the resource file is missing, and from your picture it looks like that too. Can you check what's inside <head>? There should be a link to panel.ecss or packed.css if you're using packed resources.

                • 5. Re: Fonts for outputText changed after upgrade javax.faces.jar from 2.1.6 to new 2.1.29
                  edilmar

                  Hi,

                   

                  There is this link in head:

                   

                  <script type="text/javascript" src="/sitesat2/javax.faces.resource/menugroup.js.jsf?ln=org.richfaces"></script><link type="text/css" rel="stylesheet" href="/sitesat2/rfRes/panel.ecss.jsf?db=eAFT-q00FwAEXgHd&amp;ln=org.richfaces" />

                   

                  A new question... how may I generate a compacted version of the files from Richfaces (JS/CSS) to send smaller files for the user, like you took about packed.css?