Changing font size in digital clock gadget

ajburr

New member
Local time
5:07 AM
Messages
9
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 My Computer

OS
Windows 7 64-bit
CPU
AMD Phenom II X6
Motherboard
MSI
Memory
8 GB DDR3
Graphics Card(s)
AMD Radeon HD 6950
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 My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Sager NP9170
OS
Win 7 Pro x64 / Win 10 Pro
CPU
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
Motherboard
CLEVO P170EM
Memory
12 GB
Graphics Card(s)
(1) Intel(R) HD Graphics 4000 (2) NVIDIA GeForce GTX 675M
Sound Card
(1) Realtek High Definition Audio (2) Intel(R) Display Aud
Monitor(s) Displays
17.3
Screen Resolution
1920x1080
Hard Drives
(1) Samsung 860 EVO 500GB(OS) (1) Samsung 860 EVO 500GB(Data)
Keyboard
Backlite
Antivirus
MSE, Malwarebytes Pro
Browser
Firefox
Other Info
DESKTOP: Custom-built.
OS: Win 10 Pro x64.
CASE: Rosewill R5.
CPU: Intel I5 4670K CPU @ 3.40GHz.
CPU COOLER: Cool Master Hyper 212 EVO.
MOTHERBOARD: Asus Z87-A.
MEMORY: Kingston HyperX 2x4 GB.
GPU: Nvidia Geforce 650 TI.
PSU: Corsair TX750.
DRIVES: (1) Samsung 840 120 GB SSD (2) Western Digital blue 500 GB 7200 RPM.
Attached!
 

Attachments

My Computer My Computer

OS
Windows 7 64-bit
CPU
AMD Phenom II X6
Motherboard
MSI
Memory
8 GB DDR3
Graphics Card(s)
AMD Radeon HD 6950
I need the whole folder so I can install the gadget and look at all the files so I can test.

Jerry
 

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Sager NP9170
OS
Win 7 Pro x64 / Win 10 Pro
CPU
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
Motherboard
CLEVO P170EM
Memory
12 GB
Graphics Card(s)
(1) Intel(R) HD Graphics 4000 (2) NVIDIA GeForce GTX 675M
Sound Card
(1) Realtek High Definition Audio (2) Intel(R) Display Aud
Monitor(s) Displays
17.3
Screen Resolution
1920x1080
Hard Drives
(1) Samsung 860 EVO 500GB(OS) (1) Samsung 860 EVO 500GB(Data)
Keyboard
Backlite
Antivirus
MSE, Malwarebytes Pro
Browser
Firefox
Other Info
DESKTOP: Custom-built.
OS: Win 10 Pro x64.
CASE: Rosewill R5.
CPU: Intel I5 4670K CPU @ 3.40GHz.
CPU COOLER: Cool Master Hyper 212 EVO.
MOTHERBOARD: Asus Z87-A.
MEMORY: Kingston HyperX 2x4 GB.
GPU: Nvidia Geforce 650 TI.
PSU: Corsair TX750.
DRIVES: (1) Samsung 840 120 GB SSD (2) Western Digital blue 500 GB 7200 RPM.
Well, here's the folder. But there isn't anything else in there that I know of:
 

Attachments

My Computer My Computer

OS
Windows 7 64-bit
CPU
AMD Phenom II X6
Motherboard
MSI
Memory
8 GB DDR3
Graphics Card(s)
AMD Radeon HD 6950
It only had the 2 files.

Do you have the clock working?

Jerry
 

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Sager NP9170
OS
Win 7 Pro x64 / Win 10 Pro
CPU
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
Motherboard
CLEVO P170EM
Memory
12 GB
Graphics Card(s)
(1) Intel(R) HD Graphics 4000 (2) NVIDIA GeForce GTX 675M
Sound Card
(1) Realtek High Definition Audio (2) Intel(R) Display Aud
Monitor(s) Displays
17.3
Screen Resolution
1920x1080
Hard Drives
(1) Samsung 860 EVO 500GB(OS) (1) Samsung 860 EVO 500GB(Data)
Keyboard
Backlite
Antivirus
MSE, Malwarebytes Pro
Browser
Firefox
Other Info
DESKTOP: Custom-built.
OS: Win 10 Pro x64.
CASE: Rosewill R5.
CPU: Intel I5 4670K CPU @ 3.40GHz.
CPU COOLER: Cool Master Hyper 212 EVO.
MOTHERBOARD: Asus Z87-A.
MEMORY: Kingston HyperX 2x4 GB.
GPU: Nvidia Geforce 650 TI.
PSU: Corsair TX750.
DRIVES: (1) Samsung 840 120 GB SSD (2) Western Digital blue 500 GB 7200 RPM.
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/UploadFile/ae8050/creating-windows-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 My Computer

OS
Windows 7 64-bit
CPU
AMD Phenom II X6
Motherboard
MSI
Memory
8 GB DDR3
Graphics Card(s)
AMD Radeon HD 6950
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 My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Sager NP9170
OS
Win 7 Pro x64 / Win 10 Pro
CPU
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
Motherboard
CLEVO P170EM
Memory
12 GB
Graphics Card(s)
(1) Intel(R) HD Graphics 4000 (2) NVIDIA GeForce GTX 675M
Sound Card
(1) Realtek High Definition Audio (2) Intel(R) Display Aud
Monitor(s) Displays
17.3
Screen Resolution
1920x1080
Hard Drives
(1) Samsung 860 EVO 500GB(OS) (1) Samsung 860 EVO 500GB(Data)
Keyboard
Backlite
Antivirus
MSE, Malwarebytes Pro
Browser
Firefox
Other Info
DESKTOP: Custom-built.
OS: Win 10 Pro x64.
CASE: Rosewill R5.
CPU: Intel I5 4670K CPU @ 3.40GHz.
CPU COOLER: Cool Master Hyper 212 EVO.
MOTHERBOARD: Asus Z87-A.
MEMORY: Kingston HyperX 2x4 GB.
GPU: Nvidia Geforce 650 TI.
PSU: Corsair TX750.
DRIVES: (1) Samsung 840 120 GB SSD (2) Western Digital blue 500 GB 7200 RPM.
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).
 

Attachments

Last edited:

My Computer My Computer

OS
Windows 7 64-bit
CPU
AMD Phenom II X6
Motherboard
MSI
Memory
8 GB DDR3
Graphics Card(s)
AMD Radeon HD 6950

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Sager NP9170
OS
Win 7 Pro x64 / Win 10 Pro
CPU
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
Motherboard
CLEVO P170EM
Memory
12 GB
Graphics Card(s)
(1) Intel(R) HD Graphics 4000 (2) NVIDIA GeForce GTX 675M
Sound Card
(1) Realtek High Definition Audio (2) Intel(R) Display Aud
Monitor(s) Displays
17.3
Screen Resolution
1920x1080
Hard Drives
(1) Samsung 860 EVO 500GB(OS) (1) Samsung 860 EVO 500GB(Data)
Keyboard
Backlite
Antivirus
MSE, Malwarebytes Pro
Browser
Firefox
Other Info
DESKTOP: Custom-built.
OS: Win 10 Pro x64.
CASE: Rosewill R5.
CPU: Intel I5 4670K CPU @ 3.40GHz.
CPU COOLER: Cool Master Hyper 212 EVO.
MOTHERBOARD: Asus Z87-A.
MEMORY: Kingston HyperX 2x4 GB.
GPU: Nvidia Geforce 650 TI.
PSU: Corsair TX750.
DRIVES: (1) Samsung 840 120 GB SSD (2) Western Digital blue 500 GB 7200 RPM.
Yes! That's the one I used to have before Microsoft got rid of all the custom gadgets! Thanks man! :D
 

My Computer My Computer

OS
Windows 7 64-bit
CPU
AMD Phenom II X6
Motherboard
MSI
Memory
8 GB DDR3
Graphics Card(s)
AMD Radeon HD 6950
You're welcome
If this solved your problem go ahead and mark it as solved.

Jerry
 

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Sager NP9170
OS
Win 7 Pro x64 / Win 10 Pro
CPU
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
Motherboard
CLEVO P170EM
Memory
12 GB
Graphics Card(s)
(1) Intel(R) HD Graphics 4000 (2) NVIDIA GeForce GTX 675M
Sound Card
(1) Realtek High Definition Audio (2) Intel(R) Display Aud
Monitor(s) Displays
17.3
Screen Resolution
1920x1080
Hard Drives
(1) Samsung 860 EVO 500GB(OS) (1) Samsung 860 EVO 500GB(Data)
Keyboard
Backlite
Antivirus
MSE, Malwarebytes Pro
Browser
Firefox
Other Info
DESKTOP: Custom-built.
OS: Win 10 Pro x64.
CASE: Rosewill R5.
CPU: Intel I5 4670K CPU @ 3.40GHz.
CPU COOLER: Cool Master Hyper 212 EVO.
MOTHERBOARD: Asus Z87-A.
MEMORY: Kingston HyperX 2x4 GB.
GPU: Nvidia Geforce 650 TI.
PSU: Corsair TX750.
DRIVES: (1) Samsung 840 120 GB SSD (2) Western Digital blue 500 GB 7200 RPM.
Back
Top