musiqwik_font 0.0.5 copy "musiqwik_font: ^0.0.5" to clipboard
musiqwik_font: ^0.0.5 copied to clipboard

A flutter package for the MusiQwik font. This package includes some utilities for simplifying the use of the font in Flutter.

MusiQwik font package #

A flutter package redistributing the MusiQwik font.

The MusiQwik font is a music notation font that was created by Robert Allgeyer around 2001. This package redistributes the font under the conditions of the SIL Open Font License, with some added convenience utilities to simplify its use in flutter.

The font is good for creating simple music notation. However, it is not much good for creating complex music notation such as chords and beamed notes. Though you might be able to achieve something like that with stacking items on top of each other (but I didn't try that).

Using utility TextSpans

Getting started #

install the package

flutter pub add musiqwik_font
copied to clipboard

To use the font directly in a TextStyle, you can do the following:

Text(
  '=&=4Y=!==Y==Y==%F=G=X=!=%I=H=W===>V==:==.',
  style: TextStyle(
    fontFamily: 'MusiQwik',
    package: 'musiqwik_font',
    fontSize: 48,
  ),
),
copied to clipboard

produces:

Plain Text widget

Additionally, you can use the MusiQwik static span() to return any named item as a TextSpan. This is useful if you want to use the font in a RichText widget.

RichText(
  text: TextSpan(
    children: [
      MusiQwik.barStart,
      MusiQwik.trebleClef,
      MusiQwik.keyD,
      MusiQwik.fourFourTime,
      MusiQwik.spacer,
      MusiQwik.trD4qrt,
      MusiQwik.spacer,
      MusiQwik.spacer,
      MusiQwik.trE4qrt,
      MusiQwik.spacer,
      MusiQwik.spacer,
      MusiQwik.trF4qrt,
      MusiQwik.spacer,
      MusiQwik.spacer,
      MusiQwik.trG4qrt,
      MusiQwik.spacer,
      MusiQwik.barEnd,
    ].map((obj) => obj.span()).toList(),
  ),
)
copied to clipboard

Using utility TextSpans

use a custom font size;

return RichText(
  text: TextSpan(
      children: [
        MusiQwik.barStart,
        MusiQwik.trebleClef,
        MusiQwik.keyD,
        MusiQwik.fourFourTime,
        MusiQwik.spacer,
        MusiQwik.trD4qrt,
        MusiQwik.spacer,
        MusiQwik.spacer,
        MusiQwik.trE4qrt,
        MusiQwik.spacer,
        MusiQwik.spacer,
        MusiQwik.trF4qrt,
        MusiQwik.spacer,
        MusiQwik.spacer,
        MusiQwik.trG4qrt,
        MusiQwik.spacer,
        MusiQwik.barEnd,
      ].map((obj) => obj.span(customFontSize)).toList(),
  ),
);
copied to clipboard

override font size

conventions for static names #

The names for the clefs and keys should be self-explanatory. The names for the notes are as follows:

  • trE4qrt: treble E 4th Octave quarter note
  • trCSharp4qrt: treble C# 4th Octave quarter note
  • baC4hlf: bass C 4th Octave half note

The full list of convenience names for the glyphs can be found here:

https://pub.dev/documentation/musiqwik_font/latest/musiqwik_font/MusiQwik.html

License #

The source code for the package is licensed under the MIT License.

Asset Licenses #

The package includes the [MusiQwik] font, which is distributed under the Open Font License (OFL). You can use, study, modify, and redistribute the font under the conditions of the OFL. For the complete terms and conditions, see the OFL License Text.

5
likes
160
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.08 - 2025.01.20

A flutter package for the MusiQwik font. This package includes some utilities for simplifying the use of the font in Flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on musiqwik_font