Text Size -> Largest, Larger, Medium, Smaller, Smallest

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dmsy@yahoo.com

    Text Size -> Largest, Larger, Medium, Smaller, Smallest

    Is there a way to use javascript to increase the overall document text
    size, just like if you click View->Text Size->Largest, Larger, Medium,
    Smaller, Smallest? This is on IE browser.

  • David Dorward

    #2
    Re: Text Size -> Largest, Larger, Medium, Smaller, Smallest

    dmsy@yahoo.com wrote:
    [color=blue]
    > Is there a way to use javascript to increase the overall document text
    > size, just like if you click View->Text Size->Largest, Larger, Medium,
    > Smaller, Smallest? This is on IE browser.[/color]

    You could dynamically alter the style.fontSize property of the body element
    - but why bother? Browsers already come with a way for the user to choose
    their font size, there's no need to muddy the water by duplicating
    something the browser already does but which works only on one website.

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • Duwayne Sy

      #3
      Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

      I have tried that already and it does not work. It only changes the
      size of text that does not have a size set. Text with size set by font
      remains the same. I need something that changes the whole document, just
      as how the menu items work. I need this functionallity because I am
      writting a custom browser for internal use. Some users have problems
      seeing the default text size so they need to be able to resize it.

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • David Dorward

        #4
        Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

        Duwayne Sy wrote:
        [color=blue]
        > I have tried that already and it does not work. It only changes the
        > size of text that does not have a size set. Text with size set by font
        > remains the same.[/color]

        <font> is deprecated and should not be used.
        If you specify your font sizes with font-size relative units (% or em are
        typically the best choice) then this isn't an issue.
        [color=blue]
        > I need something that changes the whole document, just
        > as how the menu items work. I need this functionallity because I am
        > writting a custom browser for internal use. Some users have problems
        > seeing the default text size so they need to be able to resize it.[/color]

        So why not add a font size preference to the browser?

        } *** Sent via SPAMSPAMSPAM http://SPAMSPAMSPAMSPAMSPAMSP***
        } Don't just SPAM USENET...get rewarded for it!

        .... while failing to quote properly. Please find a real NNTP service rather
        than this nasty spammy thing.

        --
        David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
        Home is where the ~/.bashrc is

        Comment

        • Paul R

          #5
          Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

          Why not set a browser cookie indicating which one of a set of CSS
          stylesheets a user has selected?

          You can override a FONT tag using CSS:

          <html><head><ti tle>test page</title>
          <style>body, font{ font: 20pt Arial, sans-serif; }</style>
          </head>
          <body>
          <p><font face="Times New Roman" size="2"><!-- sure enough: 20pt Arial!
          -->hello</font></p></body>
          </html>

          Comment

          • Duwayne Sy

            #6
            Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

            The <font> tag is depricated, but it does not stop anyone from using it.
            I have no control how other people author their HTML. I am not trying to
            author the HTML, just want to change the size when the users need to see
            bigger text.

            *** Sent via Developersdex http://www.developersdex.com ***
            Don't just participate in USENET...get rewarded for it!

            Comment

            • Duwayne Sy

              #7
              Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

              The issue is that users will be viewing HTML files authored by other
              people. Those HTML files, when downloaded to our servers must not be
              modified. So, they view the HTML file in this custom browser, and
              sometimes they need the text (text for the whole document, not a
              specific part of the document) to be bigger.

              *** Sent via Developersdex http://www.developersdex.com ***
              Don't just participate in USENET...get rewarded for it!

              Comment

              • Randy Webb

                #8
                Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

                Duwayne Sy wrote:
                [color=blue]
                > The <font> tag is depricated, but it does not stop anyone from using it.[/color]

                Idiots are born every minute.....
                [color=blue]
                > I have no control how other people author their HTML.[/color]

                But since you are developing an "custom browser for internal use" then
                you have control over how your "browser" displays that garbage code.
                [color=blue]
                > I am not trying to author the HTML, just want to change the size
                > when the users need to see bigger text.[/color]

                Then let them use an existing browser that has that built in. Or, code
                your "browser" so that it has a Size> Button or Menu that alters it.

                --
                Randy
                comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

                Comment

                • David Dorward

                  #9
                  Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

                  Duwayne Sy wrote:
                  [color=blue]
                  > The <font> tag is depricated, but it does not stop anyone from using it.
                  > I have no control how other people author their HTML. I am not trying to
                  > author the HTML, just want to change the size when the users need to see
                  > bigger text.[/color]

                  If you have no control over the webpage, why are you asking how to use
                  JavaScript to alter it? JavaScript typically has to be referenced from the
                  page!

                  --
                  David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
                  Home is where the ~/.bashrc is

                  Comment

                  • Duwayne Sy

                    #10
                    Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

                    I am asking because when the HTML is loaded in a typical browser, the
                    DOM model is generated. Since I am reusing IE browser control and
                    basically just showing my own menu, I have access to the DOM through the
                    exposed interfaces. If there is a way to do it in javascript, assumming
                    that javascript will be accessing the DOM, then I can do it behind the
                    scenes without touching the source.

                    *** Sent via Developersdex http://www.developersdex.com ***
                    Don't just participate in USENET...get rewarded for it!

                    Comment

                    • David Dorward

                      #11
                      Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

                      Duwayne Sy wrote:
                      [color=blue]
                      > I am asking because when the HTML is loaded in a typical browser, the
                      > DOM model is generated. Since I am reusing IE browser control[/color]

                      The IE browser control is very limited when it comes to font sizing. For
                      example, unless the user's preferences are to ignore all font sizing hits
                      whatsoever, any font sizes set using pt or px units will be impossible for
                      the user to resize. The only way to get round this is to alter the style
                      properties being applied to the element.

                      If you want decent font resizing then you should look at using a different
                      rendering engine. Gecko for instance.

                      --
                      David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
                      Home is where the ~/.bashrc is

                      Comment

                      • Duwayne Sy

                        #12
                        Re: Text Size -&gt; Largest, Larger, Medium, Smaller, Smallest

                        I would love to use Gecko. Unfortunately, because of development time,
                        we cannot use it. I hope someone write an ActiveX wrapper for Gecko that
                        exposes all the funcionality.

                        *** Sent via Developersdex http://www.developersdex.com ***
                        Don't just participate in USENET...get rewarded for it!

                        Comment

                        Working...