It is currently March 29th, 2024, 1:42 pm

Clipping text

Get help with creating, editing & fixing problems with skins
Robanada
Posts: 2
Joined: November 7th, 2010, 1:40 am

Clipping text

Post by Robanada »

Hey guys, I got the corner meter skin and I just wanted to pull out the "personal text line." I increased the font size of the "day" to fill the gap, but then rainmeter started clipping the text in the same spot every time.


I've attached a screenshot, and here's the .ini:

Code: Select all

;===================================================
;||Corner Clock TopRt Corner!                     ||
;||                                               ||
;||By Elliot Newnham                              ||
;||                                               ||
;||This is Corner Clock By GNU32 modded so that   ||
;||It can fit in the top rt corner of your screen ||
;||For the best results: Turn off 'keep on screen'||
;===================================================


[Rainmeter]
Author=Gnu32/Crome Tysnomi/Ayman Habayeb
BackgroundMode=1
DynamicWindowSize=1
Update=500

[Metadata]
Name=CornerClock
Config=CornerClock
Description=A minimalist clock and date put aside to one corner
Instructions=
Version=1.2
Tags=Time | Date | Minimalist
License=Creative Commons Attribution-Share Alike 3.0 License.
Variant=
Preview=Snap.png

[Variables]
; Font settings
FCOLOR=000000
FFACE=Helvetica

; Personal line, custom message that goes under the day
PERSONAL= 

; Time format, set to "%H:%M" for 24 hour clock or "%I:%M" for 12 hour clock
TIMEFORMAT="%H:%M"

[SimSecond]
Measure=Time
Format="%S"

[SimTime]
Measure=Time
Format=#TIMEFORMAT#

[SimDay]
Measure=Time
Format="%A"
Substitute="Monday":"MONDAY","Tuesday":"TUESDAY","Wednesday":"WEDNESDAY","Thursday":"THURSDAY","Friday":"FRIDAY","Saturday":"SATURDAY","Sunday":"SUNDAY"
UpdateDivider=60

[SimDate]
Measure=Time
Format="%d"
UpdateDivider=60

[SimMonth]
Measure=Time
Format="%B"
Substitute="January":"JANUARY","February":"FEBRUARY","March":"MARCH","April":"APRIL","May":"MAY","June":"JUNE","July":"JULY","August":"AUGUST","September":"SEPTEMBER","October":"OCTOBER","November":"NOVEMBER","December":"DECEMBER"
UpdateDivider=6000

[MSimCanvas]
Meter=STRING
W=950
H=812
X=100
Y=0

[MSimSecond]
Meter=STRING
MeasureName=SimSecond
X=530
Y=180
W=100
H=20
AntiAlias=1
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=50
StringStyle=Bold
Text=%1

[MSimTime]
Meter=STRING
MeasureName=SimTime
X=537
Y=-21r
AntiAlias=1
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=21
StringStyle=Bold
Text=%1

[MSimLaptop]
Meter=STRING
X=539
Y=220
AntiAlias=1
StringAlign=Right
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=15
StringStyle=Bold
Text=#PERSONAL#

[MSimMonth]
Meter=STRING
MeasureName=SimMonth
X=620
Y=775
H=10
W=10
AntiAlias=1
StringAlign=Right
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=65
StringStyle=Bold
Text=%1
Angle=1.57079633

[MSimDate]
Meter=STRING
MeasureName=SimDate
X=195
Y=200
W=100
H=100
AntiAlias=1
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=200
StringStyle=Bold
Text=%1

[MSimDay]
Meter=STRING
MeasureName=SimDay
X=550
Y=148
H=10
W=10
AntiAlias=1
StringAlign=Right
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=74
StringStyle=Bold
Text=%1
Any ideas?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Clipping text

Post by jsmorley »

The clipping was happening due to a combination of the "window" size being set by that string meter with no text, and some strange X= values. So that Day of the Week was being set right justified at a position where, when it drew it backwards from there, it was running out of the left side of the defined window.

Not quite sure why it was done that way originally, with a huge CPU eating window size and some things aligned left and some right, but I reworked it like this:

Code: Select all

;===================================================
;||Corner Clock TopRt Corner!                     ||
;||                                               ||
;||By Elliot Newnham                              ||
;||                                               ||
;||This is Corner Clock By GNU32 modded so that   ||
;||It can fit in the top rt corner of your screen ||
;||For the best results: Turn off 'keep on screen'||
;===================================================


[Rainmeter]
Author=Gnu32/Crome Tysnomi/Ayman Habayeb
BackgroundMode=2
;Change this to SolidColor=0,0,0,1 when you are happy
SolidColor=0,0,0,150
DynamicWindowSize=1
Update=1000

[Metadata]
Name=CornerClock
Config=CornerClock
Description=A minimalist clock and date put aside to one corner
Instructions=
Version=1.2
Tags=Time | Date | Minimalist
License=Creative Commons Attribution-Share Alike 3.0 License.
Variant=
Preview=Snap.png

[Variables]
; Font settings
FCOLOR=000000
FFACE=Helvetica

; Time format, set to "%H:%M" for 24 hour clock or "%I:%M" for 12 hour clock
TIMEFORMAT="%H:%M"

[SimSecond]
Measure=Time
Format="%S"

[SimTime]
Measure=Time
Format=#TIMEFORMAT#

[SimDay]
Measure=Time
Format="%A"

[SimDate]
Measure=Time
Format="%d"

[SimMonth]
Measure=Time
Format="%B"

[MSimTime]
Meter=STRING
MeasureName=SimTime
X=693
Y=12
AntiAlias=1
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=21
StringStyle=Bold
StringAlign=Right
Text=%1

[MSimSecond]
Meter=STRING
MeasureName=SimSecond
X=700
Y=29
AntiAlias=1
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=50
StringStyle=Bold
StringAlign=Right
Text=%1

[MSimDate]
Meter=STRING
MeasureName=SimDate
X=661
Y=50
AntiAlias=1
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=200
StringStyle=Bold
StringAlign=Right
Text=%1

[MSimMonth]
Meter=STRING
MeasureName=SimMonth
X=700
Y=625
H=10
W=10
AntiAlias=1
StringAlign=Right
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=65
StringStyle=Bold
StringCase=Upper
Text=%1
Angle=1.57079633

[MSimDayOfWeek]
Meter=STRING
MeasureName=SimDay
X=625
Y=0
AntiAlias=1
StringAlign=Right
FontColor=#FCOLOR#
FontFace=#FFACE#
FontSize=74
StringStyle=Bold
StringCase=Upper
Text=%1
Keeps it much smaller, fits on the screen without having to turn off "Stay on Screen", and generally makes more sense for me.

Removed the UpdateDivider statements from the measures. I set the whole skin to 1000 (once a second) and that should be fine. No point in telling a "month" meter to only update every 6000, as the timing is based on when you load or refresh the skin, and therefore has nothing to do with the actual time measures and there is just no reason to have any of the values lag when they actually change. This skin will use almost zero CPU in any case.

I used the new StringCase=Upper instead of the laborious Substitute statements...

I left the BackgroundMode=2 with a dark SolidColor so you can see the resulting "window" size, just change that to SolidColor=0,0,0,1 when you are done messing with it to make that background invisible.
11-6-2010 11-10-05 PM.png
You do not have the required permissions to view the files attached to this post.
Robanada
Posts: 2
Joined: November 7th, 2010, 1:40 am

Re: Clipping text

Post by Robanada »

Wow, awesome! That was super fast, and it works great- thanks so much!

Those wonky X and W values were from me guessing and checking, haha. I wasn't really sure what each parameter did.
But the window didn't fit on the screen when I first got it- I wasn't sure what to do with that, but even that works now, too. =D
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Clipping text

Post by jsmorley »

You are welcome.

This particular skin is a tricky one if you are new to Rainmeter. Fonts have all kinds of strange attributes like "leading" and "baseline" and "x-height" and "kerning" that can make positioning them relative to each other when you use different sizes a bit of trial and error.

The Angle= function in Rainmeter is particularly seizure-inducing, as the "window" for an angled text meter is calculated first, as if the text was normal left to right, then the string is turned inside it, causing no end of head scratching about what X and Y and W and H needs to be.

The key to StringAlign is that X needs to be defined as if you are saying "center it on this position" or "right justify it starting here and working backwards".

Glad to help.