Browse Source

Merge pull request #16055 from nextcloud/design/native-fonts

Use native font stack
Jan-Christoph Borchardt 4 years ago
parent
commit
b466127b1f
37 changed files with 43 additions and 140 deletions
  1. 3 10
      apps/accessibility/css/fontdyslexic.scss
  2. 1 1
      apps/user_ldap/css/renewPassword.css
  3. 0 43
      core/css/fonts.scss
  4. 2 47
      core/css/guest.css
  5. 0 1
      core/css/server.scss
  6. 1 1
      core/css/tooltip.scss
  7. 1 1
      core/css/variables.scss
  8. 25 26
      core/fonts/LICENSE_OFL.txt
  9. BIN
      core/fonts/NotoSans-Bold-cyrillic-ext.woff2
  10. BIN
      core/fonts/NotoSans-Bold-cyrillic.woff2
  11. BIN
      core/fonts/NotoSans-Bold-devanagari.woff2
  12. BIN
      core/fonts/NotoSans-Bold-greek-ext.woff2
  13. BIN
      core/fonts/NotoSans-Bold-greek.woff2
  14. BIN
      core/fonts/NotoSans-Bold-latin-ext.woff2
  15. BIN
      core/fonts/NotoSans-Bold-latin.woff2
  16. BIN
      core/fonts/NotoSans-Bold-vietnamese.woff2
  17. BIN
      core/fonts/NotoSans-Bold.ttf
  18. BIN
      core/fonts/NotoSans-Regular-cyrillic-ext.woff2
  19. BIN
      core/fonts/NotoSans-Regular-cyrillic.woff2
  20. BIN
      core/fonts/NotoSans-Regular-devanagari.woff2
  21. BIN
      core/fonts/NotoSans-Regular-greek-ext.woff2
  22. BIN
      core/fonts/NotoSans-Regular-greek.woff2
  23. BIN
      core/fonts/NotoSans-Regular-latin-ext.woff2
  24. BIN
      core/fonts/NotoSans-Regular-latin.woff2
  25. BIN
      core/fonts/NotoSans-Regular-vietnamese.woff2
  26. BIN
      core/fonts/NotoSans-Regular.ttf
  27. BIN
      core/fonts/Nunito-Bold-latin-ext.woff2
  28. BIN
      core/fonts/Nunito-Bold.ttf
  29. BIN
      core/fonts/Nunito-Bold.woff2
  30. BIN
      core/fonts/Nunito-Regular-latin-ext.woff2
  31. BIN
      core/fonts/Nunito-Regular.ttf
  32. BIN
      core/fonts/Nunito-Regular.woff2
  33. 2 2
      core/js/tests/specs/setupchecksSpec.js
  34. 5 5
      lib/private/Avatar/Avatar.php
  35. 1 1
      lib/private/Preview/TXT.php
  36. 1 1
      settings/js/admin.js
  37. 1 1
      tests/lib/Avatar/UserAvatarTest.php

+ 3 - 10
apps/accessibility/css/fontdyslexic.scss

@@ -1,22 +1,15 @@
 @font-face {
 	font-family: 'OpenDyslexic';
 	font-style: normal;
-	font-weight: 300;
+	font-weight: 400;
 	src: url('../fonts/OpenDyslexic-Regular.woff') format('woff');
 }
 
 @font-face {
 	font-family: 'OpenDyslexic';
 	font-style: normal;
-	font-weight: normal;
-	src: url('../fonts/OpenDyslexic-Regular.woff') format('woff');
-}
-
-@font-face {
-	font-family: 'OpenDyslexic';
-	font-style: normal;
-	font-weight: 600;
+	font-weight: 700;
 	src: url('../fonts/OpenDyslexic-Bold.woff') format('woff');
 }
 
-$font-face: OpenDyslexic, 'Nunito', 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif;
+$font-face: OpenDyslexic, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';

+ 1 - 1
apps/user_ldap/css/renewPassword.css

@@ -22,7 +22,7 @@
 .tooltip {
 	position:absolute;
 	display:block;
-	font-family: 'Nunito', 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif;
+	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
 	font-style:normal;
 	font-weight:400;
 	letter-spacing:normal;

+ 0 - 43
core/css/fonts.scss

@@ -1,43 +0,0 @@
-/* latin-ext */
-@font-face {
-	font-family: 'Nunito';
-	font-style: normal;
-	font-weight: 400; /* normal */
-	src: local('Nunito Regular'), local('Nunito-Regular'),
-		url('../fonts/Nunito-Regular-latin-ext.woff2') format('woff2'),
-		url('../fonts/Nunito-Regular.ttf') format('truetype');
-	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
-}
-
-/* latin */
-@font-face {
-	font-family: 'Nunito';
-	font-style: normal;
-	font-weight: 400; /* normal */
-	src: local('Nunito Regular'), local('Nunito-Regular'),
-		url('../fonts/Nunito-Regular.woff2') format('woff2'),
-		url('../fonts/Nunito-Regular.ttf') format('truetype');
-	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
-}
-
-/* latin-ext */
-@font-face {
-	font-family: 'Nunito';
-	font-style: normal;
-	font-weight: 700; /* bold */
-	src: local('Nunito Bold'), local('Nunito-Bold'),
-		url('../fonts/Nunito-Bold-latin-ext.woff2') format('woff2'),
-		url('../fonts/Nunito-Bold.ttf') format('truetype');
-	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
-}
-
-/* latin */
-@font-face {
-	font-family: 'Nunito';
-	font-style: normal;
-	font-weight: 700; /* bold */
-	src: local('Nunito Bold'), local('Nunito-Bold'),
-		url('../fonts/Nunito-Bold.woff2') format('woff2'),
-		url('../fonts/Nunito-Bold.ttf') format('truetype');
-	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
-}

+ 2 - 47
core/css/guest.css

@@ -19,7 +19,7 @@ body {
 	font-weight: normal;
 	font-size: .8em;
 	line-height: 1.6em;
-	font-family: 'Nunito', 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif;
+	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
 	color: #000;
 	text-align: center;
 	background-color: #0082c9;
@@ -183,7 +183,7 @@ form #datadirField legend {
 
 
 input, textarea, select, button, div[contenteditable=true] {
-	font-family: 'Nunito', 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif;
+	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
 }
 input,
 input:not([type='range']),
@@ -848,48 +848,3 @@ label.infield,
 a.legal {
 	font-size: smaller;
 }
-
-
-/* latin-ext */
-@font-face {
-	font-family: 'Nunito';
-	font-style: normal;
-	font-weight: 400; /* normal */
-	src: local('Nunito Regular'), local('Nunito-Regular'),
-		url('../fonts/Nunito-Regular-latin-ext.woff2') format('woff2'),
-		url('../fonts/Nunito-Regular.ttf') format('truetype');
-	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
-}
-
-/* latin */
-@font-face {
-	font-family: 'Nunito';
-	font-style: normal;
-	font-weight: 400; /* normal */
-	src: local('Nunito Regular'), local('Nunito-Regular'),
-		url('../fonts/Nunito-Regular.woff2') format('woff2'),
-		url('../fonts/Nunito-Regular.ttf') format('truetype');
-	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
-}
-
-/* latin-ext */
-@font-face {
-	font-family: 'Nunito';
-	font-style: normal;
-	font-weight: 700; /* bold */
-	src: local('Nunito Bold'), local('Nunito-Bold'),
-		url('../fonts/Nunito-Bold-latin-ext.woff2') format('woff2'),
-		url('../fonts/Nunito-Bold.ttf') format('truetype');
-	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
-}
-
-/* latin */
-@font-face {
-	font-family: 'Nunito';
-	font-style: normal;
-	font-weight: 700; /* bold */
-	src: local('Nunito Bold'), local('Nunito-Bold'),
-		url('../fonts/Nunito-Bold.woff2') format('woff2'),
-		url('../fonts/Nunito-Bold.ttf') format('truetype');
-	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
-}

+ 0 - 1
core/css/server.scss

@@ -2,7 +2,6 @@
 @import 'inputs.scss';
 @import 'header.scss';
 @import 'icons.scss';
-@import 'fonts.scss';
 @import 'apps.scss';
 @import 'global.scss';
 @import 'fixes.scss';

+ 1 - 1
core/css/tooltip.scss

@@ -13,7 +13,7 @@
 .tooltip {
     position: absolute;
     display: block;
-    font-family: 'Nunito', 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif;
+    font-family: var(--font-face);
     font-style: normal;
     font-weight: normal;
     letter-spacing: normal;

+ 1 - 1
core/css/variables.scss

@@ -79,7 +79,7 @@ $border-radius-large: 10px !default;
 // Pill-style button, value is large so big buttons also have correct roundness
 $border-radius-pill: 100px !default;
 
-$font-face: 'Nunito', 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif !default;
+$font-face: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
 
 $animation-quick: 100ms;
 $animation-slow: 300ms;

+ 25 - 26
core/fonts/OFL.txt → core/fonts/LICENSE_OFL.txt

@@ -1,29 +1,28 @@
-Copyright 2014 The Nunito Project Authors (contact@sansoxygen.com)
+This Font Software is licensed under the SIL Open Font License,
+Version 1.1.
 
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
 This license is copied below, and is also available with a FAQ at:
 http://scripts.sil.org/OFL
 
-
 -----------------------------------------------------------
 SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
 -----------------------------------------------------------
 
 PREAMBLE
 The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
+development of collaborative font projects, to support the font
+creation efforts of academic and linguistic communities, and to
+provide a free and open framework in which fonts may be shared and
+improved in partnership with others.
 
 The OFL allows the licensed fonts to be used, studied, modified and
 redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded, 
+fonts, including any derivative works, can be bundled, embedded,
 redistributed and/or sold with any software provided that any reserved
 names are not used by derivative works. The fonts and derivatives,
 however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
+requirement for fonts to remain under this license does not apply to
+any document created using the fonts or their derivatives.
 
 DEFINITIONS
 "Font Software" refers to the set of files released by the Copyright
@@ -33,25 +32,25 @@ include source files, build scripts and documentation.
 "Reserved Font Name" refers to any names specified as such after the
 copyright statement(s).
 
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
+"Original Version" refers to the collection of Font Software
+components as distributed by the Copyright Holder(s).
 
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
+"Modified Version" refers to any derivative made by adding to,
+deleting, or substituting -- in part or in whole -- any of the
+components of the Original Version, by changing formats or by porting
+the Font Software to a new environment.
 
 "Author" refers to any designer, engineer, programmer, technical
 writer or other person who contributed to the Font Software.
 
 PERMISSION & CONDITIONS
 Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
+a copy of the Font Software, to use, study, copy, merge, embed,
+modify, redistribute, and sell modified and unmodified copies of the
+Font Software, subject to the following conditions:
 
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
+1) Neither the Font Software nor any of its individual components, in
+Original or Modified Versions, may be sold by itself.
 
 2) Original or Modified Versions of the Font Software may be bundled,
 redistributed and/or sold with any software, provided that each copy
@@ -61,9 +60,9 @@ in the appropriate machine-readable metadata fields within text or
 binary files as long as those fields can be easily viewed by the user.
 
 3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
+Name(s) unless explicit written permission is granted by the
+corresponding Copyright Holder. This restriction only applies to the
+primary font name as presented to the users.
 
 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
 Software shall not be used to promote, endorse or advertise any
@@ -74,8 +73,8 @@ permission.
 5) The Font Software, modified or unmodified, in part or in whole,
 must be distributed entirely under this license, and must not be
 distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
+remain under this license does not apply to any document created using
+the Font Software.
 
 TERMINATION
 This license becomes null and void if any of the above conditions are

BIN
core/fonts/NotoSans-Bold-cyrillic-ext.woff2


BIN
core/fonts/NotoSans-Bold-cyrillic.woff2


BIN
core/fonts/NotoSans-Bold-devanagari.woff2


BIN
core/fonts/NotoSans-Bold-greek-ext.woff2


BIN
core/fonts/NotoSans-Bold-greek.woff2


BIN
core/fonts/NotoSans-Bold-latin-ext.woff2


BIN
core/fonts/NotoSans-Bold-latin.woff2


BIN
core/fonts/NotoSans-Bold-vietnamese.woff2


BIN
core/fonts/NotoSans-Bold.ttf


BIN
core/fonts/NotoSans-Regular-cyrillic-ext.woff2


BIN
core/fonts/NotoSans-Regular-cyrillic.woff2


BIN
core/fonts/NotoSans-Regular-devanagari.woff2


BIN
core/fonts/NotoSans-Regular-greek-ext.woff2


BIN
core/fonts/NotoSans-Regular-greek.woff2


BIN
core/fonts/NotoSans-Regular-latin-ext.woff2


BIN
core/fonts/NotoSans-Regular-latin.woff2


BIN
core/fonts/NotoSans-Regular-vietnamese.woff2


BIN
core/fonts/NotoSans-Regular.ttf


BIN
core/fonts/Nunito-Bold-latin-ext.woff2


BIN
core/fonts/Nunito-Bold.ttf


BIN
core/fonts/Nunito-Bold.woff2


BIN
core/fonts/Nunito-Regular-latin-ext.woff2


BIN
core/fonts/Nunito-Regular.ttf


BIN
core/fonts/Nunito-Regular.woff2


+ 2 - 2
core/js/tests/specs/setupchecksSpec.js

@@ -145,7 +145,7 @@ describe('OC.SetupChecks tests', function() {
 
 	describe('checkWOFF2Loading', function() {
 		it('should fail with another response status code than the expected one', function(done) {
-			var async = OC.SetupChecks.checkWOFF2Loading(OC.filePath('core', '', 'fonts/Nunito-Regular.woff2'), 'http://example.org/PLACEHOLDER');
+			var async = OC.SetupChecks.checkWOFF2Loading(OC.filePath('core', '', 'fonts/NotoSans-Regular-latin.woff2'), 'http://example.org/PLACEHOLDER');
 
 			suite.server.requests[0].respond(302);
 
@@ -159,7 +159,7 @@ describe('OC.SetupChecks tests', function() {
 		});
 
 		it('should return no error with the expected response status code', function(done) {
-			var async = OC.SetupChecks.checkWOFF2Loading(OC.filePath('core', '', 'fonts/Nunito-Regular.woff2'), 'http://example.org/PLACEHOLDER');
+			var async = OC.SetupChecks.checkWOFF2Loading(OC.filePath('core', '', 'fonts/NotoSans-Regular-latin.woff2'), 'http://example.org/PLACEHOLDER');
 
 			suite.server.requests[0].respond(200);
 

+ 5 - 5
lib/private/Avatar/Avatar.php

@@ -50,8 +50,8 @@ abstract 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.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.
+	 * Noto Sans cap-height is 0.715 and we want a 200px caps height size
+	 * (0.4 letter-to-total-height ratio, 500*0.4=200), so: 200/0.715 = 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
 	 *
@@ -60,7 +60,7 @@ abstract 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:279px;font-family:\'Nunito\';text-anchor:middle;fill:#fff">{letter}</text>
+			<text x="50%" y="350" style="font-weight:normal;font-size:280px;font-family:\'Noto Sans\';text-anchor:middle;fill:#fff">{letter}</text>
 		</svg>';
 
 	/**
@@ -141,7 +141,7 @@ abstract class Avatar implements IAvatar {
 			return false;
 		}
 		try {
-			$font = __DIR__ . '/../../core/fonts/Nunito-Regular.ttf';
+			$font = __DIR__ . '/../../core/fonts/NotoSans-Regular.ttf';
 			$svg = $this->getAvatarVector($size);
 			$avatar = new Imagick();
 			$avatar->setFont($font);
@@ -176,7 +176,7 @@ abstract class Avatar implements IAvatar {
 		$white = imagecolorallocate($im, 255, 255, 255);
 		imagefilledrectangle($im, 0, 0, $size, $size, $background);
 
-		$font = __DIR__ . '/../../../core/fonts/Nunito-Regular.ttf';
+		$font = __DIR__ . '/../../../core/fonts/NotoSans-Regular.ttf';
 
 		$fontSize = $size * 0.4;
 		list($x, $y) = $this->imageTTFCenter(

+ 1 - 1
lib/private/Preview/TXT.php

@@ -74,7 +74,7 @@ class TXT extends ProviderV2 {
 
 		$fontFile  = __DIR__;
 		$fontFile .= '/../../../core';
-		$fontFile .= '/fonts/Nunito-Regular.ttf';
+		$fontFile .= '/fonts/NotoSans-Regular.ttf';
 
 		$canUseTTF = function_exists('imagettftext');
 

+ 1 - 1
settings/js/admin.js

@@ -255,7 +255,7 @@ $(document).ready(function(){
 			OC.SetupChecks.checkProviderUrl(OC.getRootPath() + '/ocs-provider/', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),
 			OC.SetupChecks.checkSetup(),
 			OC.SetupChecks.checkGeneric(),
-			OC.SetupChecks.checkWOFF2Loading(OC.filePath('core', '', 'fonts/Nunito-Regular.woff2'), OC.theme.docPlaceholderUrl),
+			OC.SetupChecks.checkWOFF2Loading(OC.filePath('core', '', 'fonts/NotoSans-Regular-latin.woff2'), OC.theme.docPlaceholderUrl),
 			OC.SetupChecks.checkDataProtected()
 		).then(function (check1, check2, check3, check4, check5, check6, check7, check8, check9, check10) {
 			var messages = [].concat(check1, check2, check3, check4, check5, check6, check7, check8, check9, check10);

+ 1 - 1
tests/lib/Avatar/UserAvatarTest.php

@@ -235,7 +235,7 @@ class UserAvatarTest 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:279px;font-family:\'Nunito\';text-anchor:middle;fill:#fff">A</text>
+			<text x="50%" y="350" style="font-weight:normal;font-size:280px;font-family:\'Noto Sans\';text-anchor:middle;fill:#fff">A</text>
 		</svg>';
 		$this->assertEquals($avatar, $svg);
 	}