You might be able to write some Lua code that could evaluate a string and insert the #CRLF# variables.
Keep in mind that 1) You want to "center" the string, so when you are using variable-spaced fonts, the horizontal alignment of the various letters is correct, and 2) Be aware that you have NO control over how the letters are spaced vertically. It will be based on the default "line spacing" supported by the font you are using.
You do not have the required permissions to view the files attached to this post.
balala wrote: ↑September 14th, 2019, 11:52 am
Yes, but how do you add those #CRLF# variables between each two consecutive characters if it doesn't matter? Post please a sample code.
Right,you meant two consecutive characters from streaming weather condition from Weather.com?? Well,I think HipHopium's theme from Deviantart.com has one language file(.inc) which can automatically translate/define strings from consecutive letters to characters,I just added #CRLF# between the characters,it's doable;ex Conditions="Sunny Day":"晴#CRLF#天",
Hi.Jsmorley
Thank you for replying,I will try the Lua way later on because somehow I found the way to make multi-columns possible,I will show what I have accomplished so far.
This is theme I am working on,as you can see,it has ton of Chinese characters,but they all aligned horizontally with 9 rows from top to bottom. I would like to align them vertically with 9 columns from right to left:
I really think this is just a bridge too far. I wouldn't even now where to start with this, and it would be a real Rube Goldberg deal in my view. You would need 9 relatively positioned meters, and then use Lua to do what I did before for each meter. This would be next to impossible to do with anything but some static text you define.
ryanchuang wrote: ↑September 14th, 2019, 3:04 pm
Well,I think HipHopium's theme from Deviantart.com has one language file(.inc) which can automatically translate/define strings from consecutive letters to characters,I just added #CRLF# between the characters,it's doable;ex Conditions="Sunny Day":"晴#CRLF#天",
Yep, it indeed is doable. However not very convenient, because:
There probably are a lot of string which have to be transformed this way one by one (a lot of work, with high probability to mistake).
For instance weather.com can translate the returned strings, there is no need to use a "translation" file. In a such case although not impossible to add the needed #CRLF# character between the consecutive letters, this would require to add a new String measure to the code for each returned string which has to be transformed in this way.
For instance supposing [MeasureDesc] returns the current weather condition and this is the string you'd like to transform in the described mode, you have to add the following measure:
balala wrote: ↑September 14th, 2019, 9:05 pm
There probably are a lot of string which have to be transformed this way one by one (a lot of work, with high probability to mistake).
You're right,it's very repetitive and has to correct one by one by if something is not shown right.
balala wrote: ↑September 14th, 2019, 9:05 pm
[*]For instance weather.com can translate the returned strings, there is no need to use a "translation" file.
It does?? How?? I noticed that you're from Romania,does your weather theme for Rainmeter has Romanian from Weather.com?? I do know that Weather.com does has Română,but how does it work to show Romanian weather condition directly in Rainmeter theme,not through translate file (.inc)??
I will try your codes later on as I do not know to catch the localized weather condition directly from Weather.com without translated file (.inc).
Here is theme I have done,exactly what I have wanted:
ryanchuang wrote: ↑September 15th, 2019, 10:35 am
It does?? How?? I noticed that you're from Romania,does your weather theme for Rainmeter has Romanian from Weather.com?? I do know that Weather.com does has Română,but how does it work to show Romanian weather condition directly in Rainmeter theme,not through translate file (.inc)??
Yep, it does and weather.com is able to return the strings into a lot of languages (including Romanian, but not just, Japanese, Korean, Chinese are also available). This is done by adding an appropriate parameter to the used URL. For instance let's take the following URL: http://wxdata.weather.com/wxdata/weather/local/#Location#?cc=*&unit=#Unit#&dayf=4&locale=#LanguageCode# (the newly added parameter is marked red).
This URL returns the string into the language specified by the LanguageCode variable. As you probably have figured it out, Location is the desired weather code, Unit is either m (metric), or i (imperial), while the LanguageCode variable specifies the language in which the strings are returned. You can find the possible values of this variable here.
I played a little with creating vertical text that is read from right to left.
There are of course still the restrictions jsmorley talked about (mono-spaced font and vertical spacing). But if they doesn't matter you can probably use the following code (a combination of the skin and some lua code). The text in this skin is directly coded into a string-meter but could come from whatever source you like i guess:
-- LUA for vertical text
local ch_divider;
local contain_divider;
function Initialize()
ch_divider = SELF:GetOption('DIVIDER');
contain_divider = tonumber(SELF:GetOption('CONTAIN_DIVIDER'));
return 0;
end -- function Initialize
function Update()
return 1;
end
function getVertical(parm_text)
-- local ms = SKIN:GetMeasure('Measure_Text');
-- local parm_text = ms:GetStringValue();
local saetze = {};
local maxlen_saetze = 0;
local satz;
for satz in string.gmatch(parm_text, '([^%'..ch_divider..']+%'..ch_divider..')')
do
satz = string.gsub(satz, '^ -([^ ])', '%1');
if contain_divider == 0 then
satz = string.gsub(satz, ch_divider..'$', '');
end
if string.len(satz) > maxlen_saetze then
maxlen_saetze = string.len(satz);
end
table.insert(saetze, satz);
end
local zeilen = {};
local indexZeichen = 0;
local l, ch, aktueller_satz;
for l = 1, maxlen_saetze
do
zeilen[l] = '';
indexZeichen = indexZeichen + 1;
for aktueller_satz = 1, # saetze
do
if indexZeichen <= string.len(saetze[aktueller_satz]) then
ch = string.sub(saetze[aktueller_satz], indexZeichen, indexZeichen);
else
ch = ' ';
end
zeilen[l] = ch..zeilen[l];
end
end
local meterStr = '';
for l = 1, # zeilen
do
if l == 1 then
meterStr = zeilen[l];
else
meterStr = meterStr..'\r\n'..zeilen[l];
end
end
return meterStr;
end