Download the PHP package jacerider/neo_font without Composer

On this page you can find all versions of the php package jacerider/neo_font. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package neo_font

CONTENTS OF THIS FILE

INTRODUCTION

Provide functionality for both adding and managing fonts.

Fonts are declared in YAML by any module or theme, resolved into a plugin, and emitted as CSS through the Neo build pipeline. Each font is exposed as a .font-{selector} utility, and five semantic "roles" (primary, secondary, accent, heading, ui) can be pointed at any declared font from the admin UI.

REQUIREMENTS

This module requires Neo.

INSTALLATION

Install as you would normally install a contributed Drupal module. Visit https://www.drupal.org/node/1897420 for further information.

FONT DISCOVERY

Modules and themes can specify font definitions via a MODULE_THEME_NAME.neo.font.yml file placed in the root of the module/theme. Definitions are discovered and cached, so run drush cr after adding, editing, or removing one.

Every definition supports these top-level properties:

BAD DECLARATIONS

One rule decides what a mistake in a declaration costs: can a font be built from what was written? If it cannot, the problem is a font declaration refusal. If it can, and only the author's expectation is wrong, it is a font declaration report.

Nothing throws at discovery. A refused font is logged at error on the neo_font logger channel — naming the declaring extension, the font key as the YAML spells it, and the reason — and is then dropped: it does not exist for the rest of the request, so there is no .font-{selector} utility for it, no @font-face rule, no entry in the Google link, no option on the settings form, and no role mapping for a role that named it. Every other font is unaffected and the page still renders, so a mistyped face path costs a font rather than the site. A report is logged at warning and the font is built normally.

Prepare is where a refusal is fatal. drush neo:build (and so npm run deploy) re-reads every declaration file and fails the build if any font cannot be built, listing every refusal it found in one message rather than the first — three wrong face paths take one build to find rather than three. A report does not fail the build. Discovery is cached, so a dropped font is logged once per cache rebuild rather than once per request: the log tells you after the fact, the build tells you now, which is why adding or editing a font is a build-time act.

The conditions currently refused are: no 'family'; no 'type'; a 'type' outside 'local', 'google' and 'generic'; a derived id equal to one of the five font role names; and, for a local font, a provider that is neither an installed module nor an installed theme, no 'faces', a face with no 'src', and a 'src' that is not on disk. The only report today is a 'selector' equal to a role name — see Font Roles.

GENERIC FONTS

Generic fonts define the fallback stacks that local and Google fonts point at via their 'generic' property. This module ships 'sans', 'serif', 'mono' and 'cursive'. Use 'cursive' when defining a script font. A generic definition sets 'generic' to the raw CSS stack rather than to another font id.

LOCAL FONTS

A local font definition looks as follows. The 'faces.weight', 'faces.style' and 'faces.unicode' properties are optional. Each 'faces.src' is resolved relative to the declaring module/theme and must exist on disk — a missing file drops that one font at discovery, logging the extension, the font and the full path the check looked at, and refuses the next build. See Bad Declarations. The 'generic' property should be set to one of the generic font ids ('sans', 'serif', 'mono' or 'cursive').

Additional optional face keys: 'format' (e.g. "woff2"), 'ascent-override', 'descent-override' and 'line-gap-override'. font-display defaults to 'swap'; to override it set a 'display' key on the face.

GOOGLE FONTS

Google fonts can be used. The 'spec' property can be found on the Google Fonts site when selecting a font. A Google font is loaded from the Google CDN via a stylesheet link added to the page head (with preconnect hints).

Please see Google Fonts Locally for a better way.

The 'selector' above is optional; it is set here so this CDN-served Inter gets its own .font-inter-cdn utility rather than colliding with the local Inter declared elsewhere.

GOOGLE FONTS LOCALLY

Although Google fonts can be loaded via CDN, the recommended approach is to serve those fonts locally. This avoids the extra request and gives full control over the @font-face declarations. Download the font, place the files in your module/theme, and declare it as a type: local font.

The following website helps to extract the CSS and font files:

https://variable-font-helper.web.app/

FONT ROLES

Five semantic roles are provided: primary, secondary, accent, heading and ui. Each role is mapped to a declared font on the settings page at Administration » Configuration » Neo » Fonts (/admin/config/neo/font, permission "administer neo_font"). The mapping is stored in neo_font.settings.

Roles let a theme reference an intent ("the heading font") rather than a specific font, so the underlying font can be swapped from the admin UI without touching templates or rebuilding assets.

Role names and font selectors share one namespace, so a font declaring a 'selector' equal to a role name writes the same key as that role and one of the two is silently lost. A selector matching a role name is reported as a warning in the log today and will be refused outright in a future release — rename the selector rather than relying on the current behaviour.

USING FONTS

Each declared font produces a .font-{selector} utility bound to that specific font (e.g. .font-inter). Each role produces a font-{role} utility (font-primary, font-heading, font-ui, …) that resolves to whichever font is currently assigned to that role via a CSS variable (--font-{role}-family).

Prefer role utilities in components so fonts stay swappable:

Use a .font-{selector} utility only when you need one specific font regardless of the role configuration.

BUILD INTEGRATION

Fonts are emitted through the Neo build (see the neo_build module):


All versions of neo_font with dependencies

PHP Build Version
Package Version
Requires drupal/core Version ^10.3 || ^11
jacerider/neo Version ^1
jacerider/neo_build Version ^1
jacerider/neo_settings Version ^1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jacerider/neo_font contains the following files

Loading the files please wait ...