mirror of https://github.com/M66B/FairEmail.git
Added Croscore and Crosextra fonts
This commit is contained in:
parent
46e0b09e4d
commit
e26725b262
|
@ -36,3 +36,8 @@ FairEmail uses:
|
|||
* [Public Suffix List](https://publicsuffix.org/). Copyright © 2007–20 Mozilla Foundation. [Mozilla Public License, v. 2.0](https://mozilla.org/MPL/2.0/).
|
||||
* [Outlook Message Parser](https://github.com/bbottema/outlook-message-parser). Copyright (C) 2017 Benny Bottema. [Apache License 2.0](https://github.com/bbottema/outlook-message-parser/blob/master/LICENSE-2.0.txt).
|
||||
* [ez-vcard](https://github.com/mangstadt/ez-vcard). Copyright (c) 2012-2021, Michael Angstadt. All rights reserved. [FreeBSD License](https://github.com/mangstadt/ez-vcard/blob/master/LICENSE).
|
||||
* [Arimo font](https://fonts.google.com/specimen/Arimo). By Steve Matteson. [Apache License, Version 2.0](https://fonts.google.com/specimen/Arimo#license)
|
||||
* [Tinos font](https://fonts.google.com/specimen/Tinos). By Steve Matteson. [Apache License, Version 2.0](https://fonts.google.com/specimen/Tinos#license)
|
||||
* [Cousine font](https://fonts.google.com/specimen/Cousine). By Steve Matteson. [Apache License, Version 2.0](https://fonts.google.com/specimen/Cousine#license)
|
||||
* [Lato font](https://fonts.google.com/specimen/Lato). By Łukasz Dziedzic. [Apache License, Version 2.0](https://fonts.google.com/specimen/Lato#license)
|
||||
* [Cambo font](https://fonts.google.com/specimen/Cambo). By Huerta Tipográfica. [Apache License, Version 2.0](https://fonts.google.com/specimen/Cambo#license)
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
### [Fulgurotherium](https://en.wikipedia.org/wiki/Fulgurotherium)
|
||||
|
||||
### Next version
|
||||
|
||||
* Added Croscore and Crosextra fonts
|
||||
|
||||
### 1.1833 - 2022-02-07
|
||||
|
||||
* Added view original signature
|
||||
|
|
|
@ -40,7 +40,7 @@ FairEmail might be for you if you value your privacy.
|
|||
* Common text style options (size, color, lists, etc)
|
||||
* Battery friendly
|
||||
* Low data usage
|
||||
* Small (~20 MB)
|
||||
* Small (~25 MB)
|
||||
* Material design (including dark/black theme)
|
||||
* Maintained and supported
|
||||
|
||||
|
|
|
@ -36,3 +36,8 @@ FairEmail uses:
|
|||
* [Public Suffix List](https://publicsuffix.org/). Copyright © 2007–20 Mozilla Foundation. [Mozilla Public License, v. 2.0](https://mozilla.org/MPL/2.0/).
|
||||
* [Outlook Message Parser](https://github.com/bbottema/outlook-message-parser). Copyright (C) 2017 Benny Bottema. [Apache License 2.0](https://github.com/bbottema/outlook-message-parser/blob/master/LICENSE-2.0.txt).
|
||||
* [ez-vcard](https://github.com/mangstadt/ez-vcard). Copyright (c) 2012-2021, Michael Angstadt. All rights reserved. [FreeBSD License](https://github.com/mangstadt/ez-vcard/blob/master/LICENSE).
|
||||
* [Arimo font](https://fonts.google.com/specimen/Arimo). By Steve Matteson. [Apache License, Version 2.0](https://fonts.google.com/specimen/Arimo#license)
|
||||
* [Tinos font](https://fonts.google.com/specimen/Tinos). By Steve Matteson. [Apache License, Version 2.0](https://fonts.google.com/specimen/Tinos#license)
|
||||
* [Cousine font](https://fonts.google.com/specimen/Cousine). By Steve Matteson. [Apache License, Version 2.0](https://fonts.google.com/specimen/Cousine#license)
|
||||
* [Lato font](https://fonts.google.com/specimen/Lato). By Łukasz Dziedzic. [Apache License, Version 2.0](https://fonts.google.com/specimen/Lato#license)
|
||||
* [Cambo font](https://fonts.google.com/specimen/Cambo). By Huerta Tipográfica. [Apache License, Version 2.0](https://fonts.google.com/specimen/Cambo#license)
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
### [Fulgurotherium](https://en.wikipedia.org/wiki/Fulgurotherium)
|
||||
|
||||
### Next version
|
||||
|
||||
* Added Croscore and Crosextra fonts
|
||||
|
||||
### 1.1833 - 2022-02-07
|
||||
|
||||
* Added view original signature
|
||||
|
|
|
@ -78,7 +78,7 @@ public class StyleHelper {
|
|||
QuoteSpan.class, IndentSpan.class,
|
||||
StrikethroughSpan.class,
|
||||
URLSpan.class,
|
||||
TypefaceSpan.class
|
||||
TypefaceSpan.class, CustomTypefaceSpan.class
|
||||
));
|
||||
|
||||
static boolean apply(int action, LifecycleOwner owner, View anchor, EditText etBody, Object... args) {
|
||||
|
@ -930,26 +930,57 @@ public class StyleHelper {
|
|||
|
||||
static TypefaceSpan getTypefaceSpan(String family, Context context) {
|
||||
String faces = family.toLowerCase(Locale.ROOT);
|
||||
if (faces.contains("arimo"))
|
||||
family = "Arimo, Arial, Verdana, sans-serif";
|
||||
if (faces.contains("tinos"))
|
||||
family = "Tinos, Times New Roman, serif";
|
||||
if (faces.contains("cousine"))
|
||||
family = "Cousine, Courier New, monospace";
|
||||
if (faces.contains("lato"))
|
||||
family = "Lato, Calibri, sans-serif";
|
||||
if (faces.contains("cambo"))
|
||||
family = "Cambo, Cambria, serif";
|
||||
if (faces.contains("comic sans"))
|
||||
family = "comic sans ms, sans-serif";
|
||||
family = "Comic Sans, Comic Sans MS, sans-serif";
|
||||
|
||||
return new CustomTypefaceSpan(family, getTypeface(family, context));
|
||||
}
|
||||
|
||||
static Typeface getTypeface(String family, Context context) {
|
||||
String faces = family.toLowerCase(Locale.ROOT);
|
||||
List<String> faces = new ArrayList<>();
|
||||
for (String face : family.split(","))
|
||||
faces.add(face
|
||||
.trim()
|
||||
.toLowerCase(Locale.ROOT)
|
||||
.replace("\"", ""));
|
||||
|
||||
if (faces.equals("fairemail"))
|
||||
if (faces.contains("fairemail"))
|
||||
return ResourcesCompat.getFont(context, R.font.fantasy);
|
||||
|
||||
if (faces.contains("comic sans"))
|
||||
if (faces.contains("arimo") || faces.contains("arial") || faces.contains("verdana"))
|
||||
return ResourcesCompat.getFont(context, R.font.arimo);
|
||||
|
||||
if (faces.contains("tinos") || faces.contains("times new roman"))
|
||||
return ResourcesCompat.getFont(context, R.font.tinos);
|
||||
|
||||
if (faces.contains("cousine") || faces.contains("courier new"))
|
||||
return ResourcesCompat.getFont(context, R.font.cousine);
|
||||
|
||||
if (faces.contains("lato") || faces.contains("calibri"))
|
||||
return ResourcesCompat.getFont(context, R.font.lato);
|
||||
|
||||
if (faces.contains("cambo") || faces.contains("cambria"))
|
||||
return ResourcesCompat.getFont(context, R.font.cambo);
|
||||
|
||||
if (faces.contains("comic sans") || faces.contains("comic sans ms"))
|
||||
return ResourcesCompat.getFont(context, R.font.opendyslexic);
|
||||
|
||||
for (String face : faces.split(",")) {
|
||||
face = face.trim().replace("\"", "");
|
||||
for (String face : faces) {
|
||||
Typeface tf = Typeface.create(face, Typeface.NORMAL);
|
||||
if (!tf.equals(Typeface.DEFAULT))
|
||||
return tf;
|
||||
}
|
||||
|
||||
return Typeface.DEFAULT;
|
||||
}
|
||||
|
||||
|
@ -959,7 +990,16 @@ public class StyleHelper {
|
|||
String[] fontNameValues = context.getResources().getStringArray(R.array.fontNameValues);
|
||||
for (int i = 0; i < fontNameNames.length; i++)
|
||||
result.add(new FontDescriptor(fontNameValues[i], fontNameNames[i]));
|
||||
|
||||
// https://en.wikipedia.org/wiki/Croscore_fonts
|
||||
result.add(new FontDescriptor("arimo", "Arimo (Arial, Verdana)", true));
|
||||
result.add(new FontDescriptor("tinos", "Tinos (Times New Roman)", true));
|
||||
result.add(new FontDescriptor("cousine", "Cousine (Courier New)", true));
|
||||
result.add(new FontDescriptor("lato", "Lato (Calibri)", true));
|
||||
result.add(new FontDescriptor("cambo", "Cambo (Cambria)", true));
|
||||
|
||||
result.add(new FontDescriptor("comic sans", "OpenDyslexic", true));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<font
|
||||
app:font="@font/arimo_regular"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="400" />
|
||||
<font
|
||||
app:font="@font/arimo_italic"
|
||||
app:fontStyle="italic"
|
||||
app:fontWeight="400" />
|
||||
<font
|
||||
app:font="@font/arimo_bold"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="700" />
|
||||
<font
|
||||
app:font="@font/arimo_bolditalic"
|
||||
app:fontStyle="italic"
|
||||
app:fontWeight="700" />
|
||||
</font-family>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<font
|
||||
app:font="@font/cambo_regular"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="400" />
|
||||
</font-family>
|
Binary file not shown.
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<font
|
||||
app:font="@font/cousine_regular"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="400" />
|
||||
<font
|
||||
app:font="@font/cousine_italic"
|
||||
app:fontStyle="italic"
|
||||
app:fontWeight="400" />
|
||||
<font
|
||||
app:font="@font/cousine_bold"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="700" />
|
||||
<font
|
||||
app:font="@font/cousine_bolditalic"
|
||||
app:fontStyle="italic"
|
||||
app:fontWeight="700" />
|
||||
</font-family>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<font
|
||||
app:font="@font/lato_regular"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="400" />
|
||||
<font
|
||||
app:font="@font/lato_italic"
|
||||
app:fontStyle="italic"
|
||||
app:fontWeight="400" />
|
||||
<font
|
||||
app:font="@font/lato_bold"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="700" />
|
||||
<font
|
||||
app:font="@font/lato_bold_italic"
|
||||
app:fontStyle="italic"
|
||||
app:fontWeight="700" />
|
||||
</font-family>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<font
|
||||
app:font="@font/tinos_regular"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="400" />
|
||||
<font
|
||||
app:font="@font/tinos_italic"
|
||||
app:fontStyle="italic"
|
||||
app:fontWeight="400" />
|
||||
<font
|
||||
app:font="@font/tinos_bold"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="700" />
|
||||
<font
|
||||
app:font="@font/tinos_bolditalic"
|
||||
app:fontStyle="italic"
|
||||
app:fontWeight="700" />
|
||||
</font-family>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -4,6 +4,10 @@
|
|||
|
||||
### [Fulgurotherium](https://en.wikipedia.org/wiki/Fulgurotherium)
|
||||
|
||||
### Next version
|
||||
|
||||
* Added Croscore and Crosextra fonts
|
||||
|
||||
### 1.1833 - 2022-02-07
|
||||
|
||||
* Added view original signature
|
||||
|
|
|
@ -23,7 +23,7 @@ FairEmail might be for you if you value your privacy.
|
|||
* Common text style options (size, color, lists, etc)
|
||||
* Battery friendly
|
||||
* Low data usage
|
||||
* Small (~20 MB)
|
||||
* Small (~25 MB)
|
||||
* Material design (including dark/black theme)
|
||||
* Maintained and supported
|
||||
|
||||
|
|
Loading…
Reference in New Issue