Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Changing font size in digital clock gadget


25 Oct 2012   #1

Windows 7 64-bit
 
 
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:

Quote:
<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:

Quote:
<?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 System SpecsSystem Spec
.

25 Oct 2012   #2

Microsoft Community Contributor Award Recipient

Win 7 Pro x64 / Win 8.1 Pro
 
 

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

Jerry
My System SpecsSystem Spec
25 Oct 2012   #3

Windows 7 64-bit
 
 

Attached!


Attached Files
File Type: zip clock.zip (945 Bytes, 30 views)
My System SpecsSystem Spec
.


25 Oct 2012   #4

Microsoft Community Contributor Award Recipient

Win 7 Pro x64 / Win 8.1 Pro
 
 

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

Jerry
My System SpecsSystem Spec
25 Oct 2012   #5

Windows 7 64-bit
 
 

Well, here's the folder. But there isn't anything else in there that I know of:


Attached Files
File Type: rar DigitalClock.gadget.rar (968 Bytes, 19 views)
My System SpecsSystem Spec
25 Oct 2012   #6

Microsoft Community Contributor Award Recipient

Win 7 Pro x64 / Win 8.1 Pro
 
 

It only had the 2 files.

Do you have the clock working?

Jerry
My System SpecsSystem Spec
25 Oct 2012   #7

Windows 7 64-bit
 
 

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 System SpecsSystem Spec
26 Oct 2012   #8

Microsoft Community Contributor Award Recipient

Win 7 Pro x64 / Win 8.1 Pro
 
 

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 System SpecsSystem Spec
26 Oct 2012   #9

Windows 7 64-bit
 
 

Quote:
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).


Attached Files
File Type: rar HUD-Time.gadget.rar (24.5 KB, 11 views)
My System SpecsSystem Spec
26 Oct 2012   #10

Microsoft Community Contributor Award Recipient

Win 7 Pro x64 / Win 8.1 Pro
 
 

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 System SpecsSystem Spec
Reply

 Changing font size in digital clock gadget




Thread Tools



Similar help and support threads for2: Changing font size in digital clock gadget
Thread Forum
Change Windows Clock's font size Customization
Change font size without changing anything else General Discussion
Font size changing whenever changing settings in personalization. General Discussion
Changing font size, how? General Discussion
Solved digital clock gadget Gadgets
Segou UI Font Size Keeps Changing After An RDP Session Customization
Changing font size... not the icon General Discussion

Our Sites

Site Links

About Us

Find 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 04:52 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33