You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/type/p5.Font.js
+77-24Lines changed: 77 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
import{textCoreConstants}from'./textCore';
6
6
import*asconstantsfrom'../core/constants';
7
+
import{UnicodeRange}from'@japont/unicode-range';
8
+
import{unicodeRanges}from'./unicodeRanges';
7
9
8
10
/*
9
11
API:
@@ -789,7 +791,7 @@ function parseCreateArgs(...args/*path, name, onSuccess, onError*/) {
789
791
}
790
792
791
793
// get the callbacks/descriptors if any
792
-
letsuccess,error,descriptors;
794
+
letsuccess,error,options;
793
795
for(leti=0;i<args.length;i++){
794
796
constarg=args[i];
795
797
if(typeofarg==='function'){
@@ -800,11 +802,11 @@ function parseCreateArgs(...args/*path, name, onSuccess, onError*/) {
800
802
}
801
803
}
802
804
elseif(typeofarg==='object'){
803
-
descriptors=arg;
805
+
options=arg;
804
806
}
805
807
}
806
808
807
-
return{ path, name, success, error,descriptors};
809
+
return{ path, name, success, error,options};
808
810
}
809
811
810
812
functionfont(p5,fn){
@@ -878,7 +880,7 @@ function font(p5, fn) {
878
880
* @param {String} path path of the font or CSS file to be loaded, or a CSS `@font-face` string.
879
881
* @param {String} [name] An alias that can be used for this font in `textFont()`. Defaults to the name in the font's metadata.
880
882
* @param {Object} [options] An optional object with extra CSS font face descriptors, or p5.js font settings.
881
-
* @param {Number} [options.index] An optional index specifying which font from a CSS file to use. Defaults to the last one in the file.
883
+
* @param {String|Array<String>} [options.sets] (Experimental) An optional string of list of strings with Unicode character set names that should be included. When a CSS file is used as the font, it may contain multiple font files. The font best matching the requested character sets will be picked.
882
884
* @param {Function} [successCallback] function called with the
0 commit comments