The misc package.
This package contains miscellaneous classes, modules and functions.
See also expyriment.misc.extras for more misc.
Add fonts to Expyriment.
All truetype fonts found in the given folder will be added to Expyriment, such that they are found when only giving their name (i.e. without the full path).
Parameters : | folder : str or unicode
|
---|
Helper function to compare input_code with a standard codes.
Returns a boolean and operates by default bitwise.
Parameters : | input_code : int
standard_codes : int or list
bitwise_comparison : bool, optional
|
---|
Find an installed font given a font name.
This will try to match a font installed on the system that is similar to the given font name.
Parameters : | font : str
|
---|---|
Returns : | font : str
|
List all fonts installed on the system.
Returns a dictionary where the key is the font name and the value is the absolute path to the font file.
Convert str to unicode.
Converts an input str or unicode object to a unicode object without throwing an exception. If fse is False, the first encoding that is tried is the encoding according to the locale settings, falling back to utf-8 encoding if this throws an error. If fse is True, the filesystem encoding is tried, falling back to utf-8. Unicode input objects are return unmodified.
Parameters : | s : str or unicode
fse : bool
|
---|---|
Returns : | A unicode-type string. : |
Convert unicode to str.
Converts an input str or unicode object to a str object without throwing an exception. If fse is False, the str is encoded according to the locale (with utf-8 as a fallback), otherwise it is encoded with the filesystemencoding. Str input objects are return unmodified.
Parameters : | u : str or unicode input text : fse : bool indicates whether the filesystem encoding should used. : (default = False) : |
---|---|
Returns : | A str-type string. : |