Skip to content

Commit

Permalink
Add firefox OS support (unverified)
Browse files Browse the repository at this point in the history
Hard-coded list right now; also having some issues verifying the
results.
  • Loading branch information
eb1 committed Jan 21, 2015
1 parent 268e7cb commit b35de8a
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,11 @@
</config-file>
<source-file src="src/android/Fonts.java" target-dir="src/org/adaptit/cordova/Fonts" />
</platform>
<!-- firefoxos -->
<platform name="firefoxos">
<js-module src="src/firefoxos/FontsProxy.js" name="FontsProxy">
<runs />
</js-module>
</platform>
<!-- wp7 and Firefox OS not currently supported -->
</plugin>
108 changes: 108 additions & 0 deletions src/firefoxos/FontsProxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/

// font list (hard-coded) from https://github.com/mozilla-b2g/moztt/blob/master/fonts.mk
var fonts = [
"AndroidClock Regular",
"AndroidClock-Large Regular",
"Clockopia",
"Droid Naskh Shift Alt",
"Roboto Bold",
"Roboto Bold Italic",
"Roboto Italic",
"Roboto Light",
"Roboto Light Italic",
"Roboto Regular",
"Roboto Thin",
"Roboto Thin Italic",
"Roboto Condensed Bold",
"Roboto Condensed Bold Italic",
"Roboto Condensed Italic",
"Roboto Condensed Regular",

"Droid Sans Mono",
"Droid Sans Thai",
"Droid Sans Hebrew",
"Droid Sans Hebrew Bold",
"Droid Sans Armenian",
"Droid Sans Ethiopic",
"Droid Sans Ethiopic Bold",
"Droid Sans Georgian",

"Droid Serif Regular",
"Droid Serif Bold",
"Droid Serif Italic",
"Droid Serif Bold Italic",

"MotoyaLMaru W3 Mono",

"Fira Sans Light",
"Fira Sans Regular",
"Fira Sans Medium",
"Fira Sans Bold",
"Fira Sans Light Italic",
"Fira Sans Regular Italic",
"Fira Sans Medium Italic",
"Fira Sans Bold Italic",
"Fira Mono Regular",
"Fira Mono Medium",
"Fira Mono Bold",

"Charis SIL Regular",
"Charis SIL Bold",
"Charis SIL Italic",
"Charis SIL Bold Italic",

"Padauk",
"Padauk Bold",
"Lohit Gujarati",
"Lohit Kannada",
"Lohit Oriya",
"Lohit Punjabi",
"Lohit Telugu",
"Noto Sans Bengali",
"Noto Sans Bengali Bold",
"Noto Sans Devangari",
"Noto Sans Devangari Bold",
"Noto Sans Khmer",
"Noto Sans Khmer Bold",
"Noto Sans Tamil",
"Noto Sans Tamil Bold"
];

// BUGBUG? Not sure what to do with these fonts
// external/moztt/AndroidFonts/MTLmr3m$(TTF_EXT):system/fonts/MTLmr3m$(TTF_EXT) \
// external/moztt/AndroidFonts/MTLc3m$(TTF_EXT):system/fonts/MTLc3m$(TTF_EXT) \
// external/moztt/Noto/NotoColorEmoji.ttf:system/fonts/NotoColorEmoji.ttf \
// external/moztt/DDCUchen-1.000/DDC_Uchen$(TTF_EXT):system/fonts/DDC_Uchen$(TTF_EXT) \
// external/moztt/Meera-06/Meera$(TTF_EXT):system/fonts/Meera$(TTF_EXT) \

function getFontList(successCB, errorCB) {
'use strict';

successCB({value: fonts});
}

var Fonts = {
getFontList: getFontList
};

require("cordova/exec/proxy").add("Fonts", Fonts);

0 comments on commit b35de8a

Please sign in to comment.