Generates a path to an asset found relative to the project's font directory.
    Passing a true value as the second argument will cause the only the path to
    be returned instead of a `url()` function
351465
def font_url(path, only_path=False, cache_buster=True):
    
    return _font_url(path, only_path, cache_buster, False)
117037
def stylesheet_url(path, only_path=False, cache_buster=True):
    
    filepath = String.unquoted(path).value
    if callable(config.STATIC_ROOT):
        try:
            _file, _storage = list(config.STATIC_ROOT(filepath))[0]
        except IndexError:
            filetime = None
        else:
            filetime = getmtime(_file, _storage)
        if filetime is None:
            filetime = 'NA'
    else:
        _path = os.path.join(config.STATIC_ROOT, filepath.strip('/'))
        filetime = getmtime(_path)
        if filetime is None:
            filetime = 'NA'
    BASE_URL = config.STATIC_URL

    url = '%s%s' % (BASE_URL, filepath)
    if cache_buster:
        url = add_cache_buster(url, filetime)
    if only_path:
        return String.unquoted(url)
    else:
        return Url.unquoted(url)
754653
function generateFont(done) {
			var engine = require('./engines/' + o.engine);
			engine(o, function(result) {
				if (result === false) {
					// Font was not created, exit
					completeTask();
					return;
				}

				if (result) {
					o = _.extend(o, result);
				}

				done();
			});
		}
41254
def pretty_path_from_project(of_file)
      Pathname.new(of_file.unicode_normalize).relative_path_from(Pathname.new(project_path)).to_s
    end
1006151
public String asset(String path) {
        Asset asset = assets.assetAt(path);
        if (asset == null) {
            // If the path starts with "/", try without
            if (path.startsWith("/")) {
                return asset(path.substring(1));
            }
            // Not found.
            throw new TemplateProcessingException("Cannot find the URL of the asset " + path);
        }
        return asset.getPath();
    }
352872
function getDemoFilePath() {
			if (!o.htmlDemo) return null;
			var name = o.htmlDemoFilename || o.fontBaseName;
			return path.join(o.destHtml, name + '.html');
		}
369028
function dirname (src) {

    if (isRemoteFile(src)) {

        // http://www.font-spider.org/////
        src = src.replace(/\/+$/, '');

        // path.dirname('http://www.font-spider.org') === 'http:/'
        if (url.parse(src).path === '/') {
            return src;
        } else {
            return path.dirname(src);
        }

    } else {
        return path.dirname(src);
    }
}
958724
def save_font_awesome(dirpath='', version="4.7.0"):
    
    directory_name = "font-awesome-{0:s}".format(version)
    directory_path = os.path.join(dirpath, directory_name)
    if os.path.exists(directory_path):
        return directory_name
    url = "https://fontawesome.com/v{0:s}/assets/font-awesome-{0:s}.zip".format(version)
    content, _encoding = download_to_bytes(url)

    try:
        zip_directory = io.BytesIO(content)
        unzip = zipfile.ZipFile(zip_directory)
        top_level_name = unzip.namelist()[0]
        unzip.extractall(dirpath)
    except Exception as err:
        raise IOError('Could not unzip content from: {0}\n{1}'.format(url, err))

    os.rename(os.path.join(dirpath, top_level_name), directory_path)

    return directory_name
69606
def rewrite_asset_path(source, path = nil)
      if Fingerjam::Base.enabled? && Fingerjam::Base.cached?(source)
        Fingerjam::Base.cached_url(source)
      else
        if path && path.respond_to?(:call)
          return path.call(source)
        elsif path && path.is_a?(String)
          return path % [source]
        end

        asset_id = rails_asset_id(source)
        if asset_id.blank?
          source
        else
          source + "?#{asset_id}"
        end
      end
    end
380
function generatePath(path = "/", params = {}) {
  return path === "/" ? path : compilePath(path)(params, { pretty: true });
}
1262402
function generateStylesheet(stylesheet) {
			o.relativeFontPath = normalizePath(o.relativeFontPath);

			// Generate font URLs to use in @font-face
			var fontSrcs = [[], []];
			o.order.forEach(function(type) {
				if (!has(o.types, type)) return;
				wf.fontsSrcsMap[type].forEach(function(font, idx) {
					if (font) {
						fontSrcs[idx].push(generateFontSrc(type, font, stylesheet));
					}
				});
			});

			// Convert urls to strings that could be used in CSS
			var fontSrcSeparator = option(wf.fontSrcSeparators, stylesheet);
			fontSrcs.forEach(function(font, idx) {
				// o.fontSrc1, o.fontSrc2
				o['fontSrc'+(idx+1)] = font.join(fontSrcSeparator);
			});
			o.fontRawSrcs = fontSrcs;

			// Read JSON file corresponding to CSS template
			var templateJson = readTemplate(o.template, o.syntax, '.json', true);
			if (templateJson) o = _.extend(o, JSON.parse(templateJson.template));

			// Now override values with templateOptions
			if (o.templateOptions) o = _.extend(o, o.templateOptions);

			// Generate CSS
			var ext = path.extname(o.template) || '.css';  // Use extension of o.template file if given, or default to .css
			o.cssTemplate = readTemplate(o.template, o.syntax, ext);
			var cssContext = _.extend(o, {
				iconsStyles: true,
				stylesheet: stylesheet
			});

			var css = renderTemplate(o.cssTemplate, cssContext);

			// Fix CSS preprocessors comments: single line comments will be removed after compilation
			if (has(['sass', 'scss', 'less', 'styl'], stylesheet)) {
				css = css.replace(/\/\* *(.*?) *\*\//g, '// $1');
			}

			// Save file
			fs.writeFileSync(getCssFilePath(stylesheet), css);
		}
874893
function buildResourceHint (hint, asset, glob) {
  var as = ''

  if (hint === 'dns-prefetch' || hint === 'preconnect') {
    if (!urlMatch(asset, glob)) {
      return ''
    }

    asset = urlParse(asset)
    if (isDuplicate(asset, true)) {
      return ''
    }
  } else {
    if (!minimatch(asset, glob) || isDuplicate(asset)) {
      return ''
    }
    if (globMatch(asset, fonts)) {
      as += ' as="font"'
    } else if (isCSS(asset)) {
      as += ' as="style"'
    }
  }

  parsedAssets.push(asset)
  return `<link rel="${hint}" href="${asset}"${as} />`
}
77791
function getCssFilePath(stylesheet) {
			var cssFilePrefix = option(wf.cssFilePrefixes, stylesheet);
			return path.join(option(o.destCssPaths, stylesheet), cssFilePrefix + o.fontBaseName + '.' + stylesheet);
		}
164317
def open_asset_path(self, *args, **kwargs):
        
        f = self.asset_path_le.text()
        d = os.path.dirname(f)
        osinter = get_interface()
        osinter.open_path(d)
479657
def _output_path(
        self,
        ufo_or_font_name,
        ext,
        is_instance=False,
        interpolatable=False,
        autohinted=False,
        is_variable=False,
        output_dir=None,
        suffix=None,
    ):
        """"""

        if isinstance(ufo_or_font_name, basestring):
            font_name = ufo_or_font_name
        elif ufo_or_font_name.path:
            font_name = os.path.splitext(
                os.path.basename(os.path.normpath(ufo_or_font_name.path))
            )[0]
        else:
            font_name = self._font_name(ufo_or_font_name)

        if output_dir is None:
            output_dir = self._output_dir(
                ext, is_instance, interpolatable, autohinted, is_variable
            )
        if not os.path.exists(output_dir):
            os.makedirs(output_dir)

        if suffix:
            return os.path.join(output_dir, "{}-{}.{}".format(font_name, suffix, ext))
        else:
            return os.path.join(output_dir, "{}.{}".format(font_name, ext))
1217942
def get_asset_url(module: str, path: str) -> str:
    
    return '{}/{}/{}'.format(
        settings.STATIC_URL.rstrip('/'),
        module,
        path.lstrip('/'),
    )
468948
function FontpathRenderer(options) {
    if (!(this instanceof FontpathRenderer))
        return new FontpathRenderer(options)
    Base.call(this, options)

    this.data = {
        glyphs: [],
        underlines: []
    }
}