Changing font size in digital clock gadget

Page 1 of 2 12 LastLast

  1. Posts : 9
    Windows 7 64-bit
       #1

    Changing font size in digital clock gadget


    I don't know if anyone here can help me with this, but I found an example of how to make your own digital clock gadget in Windows 7. I liked the fact that it could be customized to any font on my computer, however, I've been trying to edit the code to increase the font size but nothing I do has an effect, including changing "font-size: 10pt;" to anything else.

    Here's the html file code:

    <html>
    <head>
    <title>Digital Clock</title>
    <style>
    body
    {
    margin: 0;
    width: 600px;
    height: 200px;
    }
    #gadgetContent
    {
    width: 500px;
    top: 150px;
    text-align: center;
    font-family: verdana;
    font-size: 10pt;
    }
    </style>
    <script language="javascript">
    function showtime()
    {
    var now=new Date();
    var h=now.getHours();
    var m=now.getMinutes();
    var s=now.getSeconds();
    h=(h<10)?"0"+h:h;
    m=(m<10)?"0"+m:m;
    s=(s<10)?"0"+s:s;
    gadgetContent.innerHTML="<h2><font color='orange'>"+h+":</font><font color='cyan'>"+m+":</font><font color='white'>"+s+"</font></h2>";
    setTimeout("showtime()",1000);
    }
    </script>
    </head>
    <body onLoad="showtime()" bgcolor="black">
    <span id="gadgetContent"></span>
    </body>
    </html>
    And here's the XML file code:

    <?xml version="1.0" encoding="utf-8" ?>
    <gadget>
    <name>DigitalClock</name>
    <namespace>Example.Azim</namespace>
    <version>1.0.0.0</version>
    <author name="Azim">
    <info url="www.example.com" />
    </author>
    <copyright>Azim</copyright>
    <description>Digital Clock</description>
    <hosts>
    <host name="sidebar">
    <base type="HTML" apiVersion="1.0.0" src="DigitalClock.html" />
    <platform minPlatformVersion="1.0" />
    <permissions>Full</permissions>
    </host>
    </hosts>
    </gadget>
    If you happen to see an error in the code that's preventing me from changing the font size, please let me know.
      My Computer


  2. Posts : 12,120
    Win 7 Pro x64 / Win 10 Pro
       #2

    Post a link to the gadget or zip up the gadget folder and post it here and I will look at it.

    Jerry
      My Computer


  3. Posts : 9
    Windows 7 64-bit
    Thread Starter
       #3

    Attached!
    Changing font size in digital clock gadget Attached Files
      My Computer


  4. Posts : 12,120
    Win 7 Pro x64 / Win 10 Pro
       #4

    I need the whole folder so I can install the gadget and look at all the files so I can test.

    Jerry
      My Computer


  5. Posts : 9
    Windows 7 64-bit
    Thread Starter
       #5

    Well, here's the folder. But there isn't anything else in there that I know of:
    Changing font size in digital clock gadget Attached Files
      My Computer


  6. Posts : 12,120
    Win 7 Pro x64 / Win 10 Pro
       #6

    It only had the 2 files.

    Do you have the clock working?

    Jerry
      My Computer


  7. Posts : 9
    Windows 7 64-bit
    Thread Starter
       #7

    Yep, it works just fine. It uses military time, but I don't mind that so much. Any ideas on how to modify the font size?

    By the way, here's the link where I got the files and instructions: http://www.c-sharpcorner.com/UploadF...indows-gadget/

    I chose this because it seemed simple and I could choose whatever font I wanted. Obviously it's not quite as simple as I thought.
      My Computer


  8. Posts : 12,120
    Win 7 Pro x64 / Win 10 Pro
       #8

    Wow I have never seen such a simple gadget with only two files, but for the life of me I cannot find a way to change the text size. I'm sure if you did a little more looking around you can find a digital clock gadget that would allow all a little bit more customizing.

    Jerry
      My Computer


  9. Posts : 9
    Windows 7 64-bit
    Thread Starter
       #9

    I'm sure if you did a little more looking around you can find a digital clock gadget that would allow all a little bit more customizing.
    LOL You would think so, wouldn't you? I've searched high and low, and this is the only one I could find that would allow me to choose my font.


    EDIT: There is another clock gadget I tried, but I dismissed it because there seems to be a space constraint when I used certain fonts. The numbers and letters end up over-lapping. Maybe that gadget would be the way to go, but could you look to see how I could make it bigger (not the font, but the clock dimensions themselves).
    Changing font size in digital clock gadget Attached Files
    Last edited by ajburr; 26 Oct 2012 at 09:01.
      My Computer


  10. Posts : 12,120
    Win 7 Pro x64 / Win 10 Pro
       #10

    Here is one that will let you to change the font and the color and the size of the font.

    Digital - clocket6 by ~clockets on deviantART

    Jerry
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:52.
Find Us