Skip to content

Commit c684a72

Browse files
committed
feat: Support multi-resolution for Windows Cursors
1 parent ff9aaa7 commit c684a72

7 files changed

+586
-188
lines changed

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ Open source macOS Cursors for `Windows` and `Linux` with _HiDPI Support_ .
4040

4141
### Windows Cursor Size:
4242

43-
- <kbd>16x16</kbd> - Small
44-
- <kbd>24x24</kbd> - Regular
45-
- <kbd>32x32</kbd> - Large
46-
- <kbd>48x48</kbd> - Extra Large
43+
| size | Regular (× ²⁄₃) | Large (× ⁴⁄₅) | Extra-Large (× 1) |
44+
| ---: | --------------: | ------------: | ----------------: |
45+
| 32 | 21.333 → 22 | 25.6 → 26 | 32 |
46+
| 48 | 32 | 38.4 → 39 | 48 |
47+
| 64 | 42.666 → 43 | 51.2 → 52 | 64 |
48+
| 96 | 64 | 76.8 → 77 | 96 |
49+
| 128 | 85.333 → 86 | 102.4 → 103 | 128 |
50+
| 256 | 170.666 → 171 | 204.8 → 205 | 256 |
4751

4852
## Colors
4953

build.sh

+8-9
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ get_config_file() {
2121

2222
with_version() {
2323
local comment="${1}"
24-
echo "$comment ($version)."
24+
echo "$comment ($version)"
2525
}
2626

2727
if ! type -p ctgen >/dev/null; then
@@ -30,8 +30,8 @@ if ! type -p ctgen >/dev/null; then
3030
fi
3131

3232
declare -A names
33-
names["macOS"]=$(with_version "macOS cursors")
34-
names["macOS-White"]=$(with_version "White macOS cursors")
33+
names["macOS"]=$(with_version "macOS")
34+
names["macOS-White"]=$(with_version "White macOS")
3535

3636
# Cleanup old builds
3737
rm -rf themes bin
@@ -41,7 +41,7 @@ for key in "${!names[@]}"; do
4141
comment="${names[$key]}"
4242
cfg=$(get_config_file key)
4343

44-
ctgen "$cfg" -p x11 -d "bitmaps/$key" -n "$key" -c "$comment" &
44+
ctgen "configs/x.$cfg" -p x11 -d "bitmaps/$key" -n "$key" -c "$comment XCursors" &
4545
PID=$!
4646
wait $PID
4747
done
@@ -51,10 +51,9 @@ for key in "${!names[@]}"; do
5151
comment="${names[$key]}"
5252
cfg=$(get_config_file key)
5353

54-
ctgen "$cfg" -p windows -s 16 -d "bitmaps/$key" -n "$key-Small" -c "$comment" &
55-
ctgen "$cfg" -p windows -s 24 -d "bitmaps/$key" -n "$key-Regular" -c "$comment" &
56-
ctgen "$cfg" -p windows -s 32 -d "bitmaps/$key" -n "$key-Large" -c "$comment" &
57-
ctgen "$cfg" -p windows -s 48 -d "bitmaps/$key" -n "$key-Extra-Large" -c "$comment" &
54+
ctgen "configs/win_rg.$cfg" -d "bitmaps/$key" -n "$key-Regular" -c "$comment Regular Windows Cursors" &
55+
ctgen "configs/win_lg.$cfg" -d "bitmaps/$key" -n "$key-Large" -c "$comment Large Windows Cursors" &
56+
ctgen "configs/win_xl.$cfg" -d "bitmaps/$key" -n "$key-Extra-Large" -c "$comment Extra Large Windows Cursors" &
5857
PID=$!
5958
wait $PID
6059
done
@@ -77,7 +76,7 @@ wait $PID
7776

7877
# Compressing macOS-*-Windows
7978
for key in "${!names[@]}"; do
80-
zip -rv "../bin/${key}-Windows.zip" "${key}-Small-Windows" "${key}-Regular-Windows" "${key}-Large-Windows" "${key}-Extra-Large-Windows" &
79+
zip -rv "../bin/${key}-Windows.zip" "${key}-Regular-Windows" "${key}-Large-Windows" "${key}-Extra-Large-Windows" &
8180
PID=$!
8281
wait $PID
8382
done

configs/win_lg.build.toml

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[theme]
2+
name = 'macOS-Large'
3+
comment = 'macOS Large Windows cursors'
4+
website = 'https://github.com/ful1e5/apple_cursor'
5+
6+
[config]
7+
bitmaps_dir = '' # This config will assigned with `ctgen -d <path>`
8+
out_dir = '../themes'
9+
platforms = 'windows'
10+
11+
[cursors]
12+
[cursors.fallback_settings]
13+
win_sizes = [26, 39, 52, 77, 103, 205]
14+
x_hotspot = 128
15+
y_hotspot = 128
16+
win_delay = 1
17+
18+
[cursors.all-scroll]
19+
png = 'all-scroll.png'
20+
win_name = 'Move'
21+
22+
[cursors.bottom_left_corner]
23+
png = 'bottom_left_corner.png'
24+
win_name = 'Dng2'
25+
26+
[cursors.bottom_right_corner]
27+
png = 'bottom_right_corner.png'
28+
win_name = 'Dng1'
29+
30+
[cursors.cross]
31+
png = 'cross.png'
32+
win_name = 'Cross'
33+
34+
[cursors.crossed_circle]
35+
png = 'crossed_circle.png'
36+
x_hotspot = 56
37+
y_hotspot = 17
38+
win_name = 'Unavailiable'
39+
40+
[cursors.hand1]
41+
png = 'hand1.png'
42+
x_hotspot = 134
43+
y_hotspot = 81
44+
win_name = 'Pan'
45+
46+
[cursors.hand2]
47+
png = 'hand2.png'
48+
x_hotspot = 92
49+
y_hotspot = 53
50+
win_name = 'Link'
51+
52+
[cursors.left_ptr]
53+
png = 'left_ptr.png'
54+
x_hotspot = 80
55+
y_hotspot = 38
56+
win_name = 'Pointer'
57+
58+
[cursors.left_ptr_watch]
59+
png = 'left_ptr_watch-*.png'
60+
x_hotspot = 56
61+
y_hotspot = 17
62+
win_sizes = 77
63+
win_name = 'Work'
64+
65+
[cursors.move]
66+
png = 'move.png'
67+
x_hotspot = 139
68+
y_hotspot = 86
69+
win_name = 'Grabbing'
70+
71+
[cursors.pencil]
72+
png = 'pencil.png'
73+
x_hotspot = 37
74+
y_hotspot = 218
75+
win_name = 'Handwriting'
76+
77+
[cursors.question_arrow]
78+
png = 'question_arrow.png'
79+
x_hotspot = 128
80+
y_hotspot = 169
81+
win_name = 'Help'
82+
83+
[cursors.right_ptr]
84+
png = 'right_ptr.png'
85+
x_hotspot = 179
86+
y_hotspot = 40
87+
win_name = 'Alternate'
88+
89+
[cursors.sb_h_double_arrow]
90+
png = 'sb_h_double_arrow.png'
91+
win_name = 'Horz'
92+
93+
[cursors.sb_v_double_arrow]
94+
png = 'sb_v_double_arrow.png'
95+
win_name = 'Vert'
96+
97+
[cursors.wait]
98+
png = 'wait-*.png'
99+
win_sizes = 77
100+
win_name = 'Busy'
101+
102+
[cursors.xterm]
103+
png = 'xterm.png'
104+
x_hotspot = 129
105+
y_hotspot = 136
106+
win_name = 'Text'
107+
108+
[cursors.zoom-in]
109+
png = 'zoom-in.png'
110+
x_hotspot = 99
111+
y_hotspot = 98
112+
win_name = 'Zoom-in'
113+
114+
[cursors.zoom-out]
115+
png = 'zoom-out.png'
116+
x_hotspot = 99
117+
y_hotspot = 98
118+
win_name = 'Zoom-out'
119+
120+
[cursors.person]
121+
png = 'person.png'
122+
x_hotspot = 56
123+
y_hotspot = 17
124+
win_name = 'Person'
125+
126+
[cursors.pin]
127+
png = 'pin.png'
128+
x_hotspot = 56
129+
y_hotspot = 17
130+
win_name = 'Pin'

configs/win_rg.build.toml

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[theme]
2+
name = 'macOS-Regular'
3+
comment = 'macOS Regular Windows cursors'
4+
website = 'https://github.com/ful1e5/apple_cursor'
5+
6+
[config]
7+
bitmaps_dir = '' # This config will assigned with `ctgen -d <path>`
8+
out_dir = '../themes'
9+
platforms = 'windows'
10+
11+
[cursors]
12+
[cursors.fallback_settings]
13+
win_sizes = [22, 32, 43, 64, 86, 171]
14+
x_hotspot = 128
15+
y_hotspot = 128
16+
win_delay = 1
17+
18+
[cursors.all-scroll]
19+
png = 'all-scroll.png'
20+
win_name = 'Move'
21+
22+
[cursors.bottom_left_corner]
23+
png = 'bottom_left_corner.png'
24+
win_name = 'Dng2'
25+
26+
[cursors.bottom_right_corner]
27+
png = 'bottom_right_corner.png'
28+
win_name = 'Dng1'
29+
30+
[cursors.cross]
31+
png = 'cross.png'
32+
win_name = 'Cross'
33+
34+
[cursors.crossed_circle]
35+
png = 'crossed_circle.png'
36+
x_hotspot = 56
37+
y_hotspot = 17
38+
win_name = 'Unavailiable'
39+
40+
[cursors.hand1]
41+
png = 'hand1.png'
42+
x_hotspot = 134
43+
y_hotspot = 81
44+
win_name = 'Pan'
45+
46+
[cursors.hand2]
47+
png = 'hand2.png'
48+
x_hotspot = 92
49+
y_hotspot = 53
50+
win_name = 'Link'
51+
52+
[cursors.left_ptr]
53+
png = 'left_ptr.png'
54+
x_hotspot = 80
55+
y_hotspot = 38
56+
win_name = 'Pointer'
57+
58+
[cursors.left_ptr_watch]
59+
png = 'left_ptr_watch-*.png'
60+
x_hotspot = 56
61+
y_hotspot = 17
62+
win_sizes = 65
63+
win_name = 'Work'
64+
65+
[cursors.move]
66+
png = 'move.png'
67+
x_hotspot = 139
68+
y_hotspot = 86
69+
win_name = 'Grabbing'
70+
71+
[cursors.pencil]
72+
png = 'pencil.png'
73+
x_hotspot = 37
74+
y_hotspot = 218
75+
win_name = 'Handwriting'
76+
77+
[cursors.question_arrow]
78+
png = 'question_arrow.png'
79+
x_hotspot = 128
80+
y_hotspot = 169
81+
win_name = 'Help'
82+
83+
[cursors.right_ptr]
84+
png = 'right_ptr.png'
85+
x_hotspot = 179
86+
y_hotspot = 40
87+
win_name = 'Alternate'
88+
89+
[cursors.sb_h_double_arrow]
90+
png = 'sb_h_double_arrow.png'
91+
win_name = 'Horz'
92+
93+
[cursors.sb_v_double_arrow]
94+
png = 'sb_v_double_arrow.png'
95+
win_name = 'Vert'
96+
97+
[cursors.wait]
98+
png = 'wait-*.png'
99+
win_sizes = 65
100+
win_name = 'Busy'
101+
102+
[cursors.xterm]
103+
png = 'xterm.png'
104+
x_hotspot = 129
105+
y_hotspot = 136
106+
win_name = 'Text'
107+
108+
[cursors.zoom-in]
109+
png = 'zoom-in.png'
110+
x_hotspot = 99
111+
y_hotspot = 98
112+
win_name = 'Zoom-in'
113+
114+
[cursors.zoom-out]
115+
png = 'zoom-out.png'
116+
x_hotspot = 99
117+
y_hotspot = 98
118+
win_name = 'Zoom-out'
119+
120+
[cursors.person]
121+
png = 'person.png'
122+
x_hotspot = 56
123+
y_hotspot = 17
124+
win_name = 'Person'
125+
126+
[cursors.pin]
127+
png = 'pin.png'
128+
x_hotspot = 56
129+
y_hotspot = 17
130+
win_name = 'Pin'

0 commit comments

Comments
 (0)