diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-23 14:28:55 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-23 14:30:23 +0200 |
commit | 782927a05f6d3340aaf28a26c0c3075f5cafc430 (patch) | |
tree | 6c4377efc332dda13b586ce79a588ea29a568424 | |
parent | 1fb885638ec3f45b2580db3ef86b5b70ad544412 (diff) | |
download | nextcloud-server-782927a05f6d3340aaf28a26c0c3075f5cafc430.tar.gz nextcloud-server-782927a05f6d3340aaf28a26c0c3075f5cafc430.zip |
fixup! Fix comment and cap-height
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r-- | lib/private/Avatar.php | 6 | ||||
-rw-r--r-- | tests/lib/AvatarTest.php | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Avatar.php b/lib/private/Avatar.php index baa0f74492b..97e1c0535a4 100644 --- a/lib/private/Avatar.php +++ b/lib/private/Avatar.php @@ -63,8 +63,8 @@ class Avatar implements IAvatar { /** * https://github.com/sebdesign/cap-height -- for 500px height * Automated check: https://codepen.io/skjnldsv/pen/PydLBK/ - * Nunito cap-height is 0.713 and we want a 200px caps height size - * (0.4 letter-to-total-height ratio, 500*0.4=200), so: 200/0.713 = 280px. + * Nunito cap-height is 0.716 and we want a 200px caps height size + * (0.4 letter-to-total-height ratio, 500*0.4=200), so: 200/0.716 = 279px. * Since we start from the baseline (text-anchor) we need to * shift the y axis by 100px (half the caps height): 500/2+100=350 * @@ -73,7 +73,7 @@ class Avatar implements IAvatar { private $svgTemplate = '<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg width="{size}" height="{size}" version="1.1" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"> <rect width="100%" height="100%" fill="#{fill}"></rect> - <text x="50%" y="350" style="font-weight:normal;font-size:280px;font-family:\'Nunito\';text-anchor:middle;fill:#fff">{letter}</text> + <text x="50%" y="350" style="font-weight:normal;font-size:279px;font-family:\'Nunito\';text-anchor:middle;fill:#fff">{letter}</text> </svg>'; /** diff --git a/tests/lib/AvatarTest.php b/tests/lib/AvatarTest.php index 5d72ec02e2b..c8c9d3b8317 100644 --- a/tests/lib/AvatarTest.php +++ b/tests/lib/AvatarTest.php @@ -235,7 +235,7 @@ class AvatarTest extends \Test\TestCase { $svg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg width="64" height="64" version="1.1" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"> <rect width="100%" height="100%" fill="#0082c9"></rect> - <text x="50%" y="350" style="font-weight:normal;font-size:280px;font-family:\'Nunito\';text-anchor:middle;fill:#fff">A</text> + <text x="50%" y="350" style="font-weight:normal;font-size:279px;font-family:\'Nunito\';text-anchor:middle;fill:#fff">A</text> </svg>'; $this->assertEquals($avatar, $svg); } |