Bottleneck method for loading fonts, calls {@link FontFactory#register(java.lang.String) } for iText, {@link GraphicsEnvironment#registerFont(java.awt.Font) }
for awt.
@param path the path to the font file
ed
@return
@throws VectorPrintException
163379
public LOADSTATUS loadFont(String path) throws VectorPrintException {
      try {
         File f = new File(path);
         LOADSTATUS stat = LOADSTATUS.NOT_LOADED;

         if (loadAWTFonts) {
            Font fo = Font.createFont(Font.TRUETYPE_FONT, f);
            GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(fo);
            stat = LOADSTATUS.LOADED_ONLY_AWT;
         }

         if (loadiText) {
            FontFactory.register(path);
            stat = (stat.equals(LOADSTATUS.LOADED_ONLY_AWT)) ? LOADSTATUS.LOADED_ITEXT_AND_AWT : LOADSTATUS.LOADED_ONLY_ITEXT;
            log.info(String.format("font loaded from %s", f.getAbsolutePath()));
         }

         return stat;
      } catch (FontFormatException | IOException ex) {
         log.log(Level.SEVERE, null, ex);

         throw new VectorPrintException("failed to load " + path, ex);
      }
   }
395654
@Deprecated
	public static <T> T load(ReaderHandler<T> readerHandler, String path, String charset) throws IORuntimeException {
		return FileReader.create(file(path), CharsetUtil.charset(charset)).read(readerHandler);
	}
29986
public static Properties loadProperties(String path){
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        InputStream in = null;
        try {
            in = cl.getResourceAsStream(path);

            Properties properties = new Properties();
            properties.load(in);

            return properties;

        } catch(IOException ex){
            return null;

        } finally {
            IOUtil.closeQuietly(in);
        }
    }
1143588
@Override
    public InputStream getResourceAsStream( String path )
    {
        Object in = null;
        if ( null != baseLoader )
            // classloader wants no leading slash
            in = baseLoader.getResourceAsStream( path.substring(1) );
        if ( null == in )
            return super.getResourceAsStream( path );
        return (InputStream) in;
    }
222348
public static void apply(@NonNull TextView textView, @NonNull String fontPath) {
        if (!textView.isInEditMode()) {
            setTypeface(textView, getFontFromString
                    (textView.getContext().getAssets(), fontPath, true));
        }
    }
828468
private static ImageIcon createImageIcon(String path) {
        java.net.URL imgURL = GraphPanel.class.getResource(path);
        if (imgURL != null)
            return new ImageIcon(imgURL);
        else {
            throw new RuntimeException("Couldn't find file: " + path);
            //log.error("Couldn't find file: " + path);
            //return null;
        }
    }
170696
public function setTextFont($path)
    {
        if (!is_file($path) || !is_readable($path)) {
            throw new \InvalidArgumentException(
                'Unable to load font file at ' . $path
            );
        }

        $this->textFontPath = realpath($path);

        return $this;
    }
1031435
@Override
   public void loadTiff(InputStream tiff, ImageProcessor imageProcessor, int... pages) throws VectorPrintException {
      File f = null;
      try {
         f = File.createTempFile("tiff.", "tiff");
         f.deleteOnExit();
         IOHelper.load(tiff, new FileOutputStream(f), ReportConstants.DEFAULTBUFFERSIZE, true);
         loadTiff(f, imageProcessor, pages);
      } catch (IOException ex) {
         throw new VectorPrintException(String.format("unable to load tiff"), ex);
      } finally {
         if (f != null) {
            f.delete();
         }
      }
   }
1038392
public static void loadSeg(String path) throws LoadModelException {
		if(seg==null)
		{
			String file = path+segModel;
			seg = new CWSTagger(file);
			seg.setEnFilter(isEnFilter);
		} 
	}
702653
public static Proto loadFromClasspath(String path, Proto importer) throws Exception
    {
        URL resource = getResource(path, DefaultProtoLoader.class);
        if (resource == null)
            return null;

        Proto proto = new Proto(resource, DEFAULT_INSTANCE, importer);
        ProtoUtil.loadFrom(resource, proto);
        return proto;
    }
1361770
public void registerFont (String name, java.awt.Font font) {
    if (font == null) throw new NullPointerException();
    fonts.put(name, font);
  }
675816
public ThreadContextClassLoaderBuilder addPath(final String path) {

        // Check sanity
        Validate.notEmpty(path, "path");

        // Convert to an URL, and delegate.
        final URL anUrl;
        try {
            anUrl = new File(path).toURI().toURL();
        } catch (MalformedURLException e) {
            throw new IllegalArgumentException("Could not convert path [" + path + "] to an URL.", e);
        }

        // Delegate
        return addURL(anUrl);
    }
659786
public Font getTextFont(byte field) {
		FieldInfos fi = getFieldInfos(field);
		Vector v = new Vector(m_defaultTextFontFamilyNames.length+fi.m_fontFamilyNames.length);
        Collections.addAll(v, fi.m_fontFamilyNames);
        Collections.addAll(v, m_defaultTextFontFamilyNames);
		Iterator it = v.iterator();
		Font font = null;
		String s = "";
		int style = getTextStyle(field);
		int size = (int) getTextSize(field);
		while (it.hasNext()) {
			String fontName = (String) it.next();
			if (s.length() > 0)
				s += ", ";
			s += fontName;
			if (isFontAvailable(fontName)) {
				font = new Font(fontName, style, size);
				break;
			}
		}
		if (font == null) {
			System.err.println("None of these fonts are available: " + s);
			font = new Font("Dialog", style, size);
		}
		if (fi.m_textAttributes != null) {
			font = font.deriveFont(fi.m_textAttributes);
		}
		return font;
	}
842452
public void register(String path, String alias) {
        try {
            if (path.toLowerCase().endsWith(".ttf") || path.toLowerCase().endsWith(".otf") || path.toLowerCase().indexOf(".ttc,") > 0) {
                Object allNames[] = BaseFont.getAllFontNames(path, BaseFont.WINANSI, null);
                trueTypeFonts.setProperty(((String)allNames[0]).toLowerCase(), path);
                if (alias != null) {
                    trueTypeFonts.setProperty(alias.toLowerCase(), path);
                }
                // register all the font names with all the locales
                String[][] names = (String[][])allNames[2]; //full name
                for (int i = 0; i < names.length; i++) {
                    trueTypeFonts.setProperty(names[i][3].toLowerCase(), path);
                }
                String fullName = null;
                String familyName = null;
                names = (String[][])allNames[1]; //family name
                for (int k = 0; k < TTFamilyOrder.length; k += 3) {
                    for (int i = 0; i < names.length; i++) {
                        if (TTFamilyOrder[k].equals(names[i][0]) && TTFamilyOrder[k + 1].equals(names[i][1]) && TTFamilyOrder[k + 2].equals(names[i][2])) {
                            familyName = names[i][3].toLowerCase();
                            k = TTFamilyOrder.length;
                            break;
                        }
                    }
                }
                if (familyName != null) {
                    String lastName = "";
                    names = (String[][])allNames[2]; //full name
                    for (int i = 0; i < names.length; i++) {
                        for (int k = 0; k < TTFamilyOrder.length; k += 3) {
                            if (TTFamilyOrder[k].equals(names[i][0]) && TTFamilyOrder[k + 1].equals(names[i][1]) && TTFamilyOrder[k + 2].equals(names[i][2])) {
                                fullName = names[i][3];
                                if (fullName.equals(lastName))
                                    continue;
                                lastName = fullName;
                                registerFamily(familyName, fullName, null);
                                break;
                            }
                        }
                    }
                }
            }
            else if (path.toLowerCase().endsWith(".ttc")) {
                if (alias != null)
                    System.err.println("class FontFactory: You can't define an alias for a true type collection.");
                String[] names = BaseFont.enumerateTTCNames(path);
                for (int i = 0; i < names.length; i++) {
                    register(path + "," + i);
                }
            }
            else if (path.toLowerCase().endsWith(".afm") || path.toLowerCase().endsWith(".pfm")) {
                BaseFont bf = BaseFont.createFont(path, BaseFont.CP1252, false);
                String fullName = bf.getFullFontName()[0][3].toLowerCase();
                String familyName = bf.getFamilyFontName()[0][3].toLowerCase();
                String psName = bf.getPostscriptFontName().toLowerCase();
                registerFamily(familyName, fullName, null);
                trueTypeFonts.setProperty(psName, path);
                trueTypeFonts.setProperty(fullName, path);
            }
        }
        catch(DocumentException de) {
            // this shouldn't happen
            throw new ExceptionConverter(de);
        }
        catch(IOException ioe) {
            throw new ExceptionConverter(ioe);
        }
    }
748444
public static BufferedReader getReader(Path path, Charset charset) throws IORuntimeException {
		return IoUtil.getReader(getInputStream(path), charset);
	}
1062766
@Nonnull
    public ProgramTypeRegistry registryForPath(String path) {
        return registryMap.computeIfAbsent(path, p -> new ProgramTypeRegistry(programNameFromPath(path)));
    }
1310665
public static BufferedReader newBufferedReader(Path path, Charset charset) throws IOException {
        return new BufferedReader(new InputStreamReader(newInputStream(path), charset));
    }