diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-23 14:22:55 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-23 14:22:55 +0200 |
commit | 1fb885638ec3f45b2580db3ef86b5b70ad544412 (patch) | |
tree | 4bee0cf312a5b84aa89e747d508dc861438c6f51 /lib | |
parent | 354b72b9d39caaa33308276456c958dc2b2ced66 (diff) | |
download | nextcloud-server-1fb885638ec3f45b2580db3ef86b5b70ad544412.tar.gz nextcloud-server-1fb885638ec3f45b2580db3ef86b5b70ad544412.zip |
Fix comment and cap-height
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Avatar.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/Avatar.php b/lib/private/Avatar.php index a75dfb4d60c..baa0f74492b 100644 --- a/lib/private/Avatar.php +++ b/lib/private/Avatar.php @@ -62,15 +62,18 @@ class Avatar implements IAvatar { /** * https://github.com/sebdesign/cap-height -- for 500px height - * Nunito cap-height is 0.72 and we want a 200px caps height size (0.4 letter-to-total-height ratio, 500*0.4=200). 200/0.72 = 278px. - * 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 + * 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. + * 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 * * @var string */ 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:278px;font-family:\'Nunito\';text-anchor:middle;fill:#fff">{letter}</text> + <text x="50%" y="350" style="font-weight:normal;font-size:280px;font-family:\'Nunito\';text-anchor:middle;fill:#fff">{letter}</text> </svg>'; /** |