New port: JetBrainsMono fonts

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

New port: JetBrainsMono fonts

Greg Steuck
I tested this with emacs and xterm on amd64-current.

Add JetBrainsMono fonts port
---
 fonts/Makefile                 |  1 +
 fonts/jetbrains-mono/Makefile  | 28 ++++++++++++++++++++++++++++
 fonts/jetbrains-mono/distinfo  |  2 ++
 fonts/jetbrains-mono/pkg/DESCR |  8 ++++++++
 fonts/jetbrains-mono/pkg/PLIST | 11 +++++++++++
 5 files changed, 50 insertions(+)
 create mode 100644 fonts/jetbrains-mono/Makefile
 create mode 100644 fonts/jetbrains-mono/distinfo
 create mode 100644 fonts/jetbrains-mono/pkg/DESCR
 create mode 100644 fonts/jetbrains-mono/pkg/PLIST

diff --git a/fonts/Makefile b/fonts/Makefile
index b3152654cf7..ac33b3811fb 100644
--- a/fonts/Makefile
+++ b/fonts/Makefile
@@ -45,6 +45,7 @@
      SUBDIR += ja-funetfonts
      SUBDIR += ja-kanjistrokeorders-ttf
      SUBDIR += ja-sazanami-ttf
+     SUBDIR += jetbrains-mono
      SUBDIR += jmk-fonts
      SUBDIR += junicode
      SUBDIR += ko-baekmuk-fonts
diff --git a/fonts/jetbrains-mono/Makefile b/fonts/jetbrains-mono/Makefile
new file mode 100644
index 00000000000..088bd423deb
--- /dev/null
+++ b/fonts/jetbrains-mono/Makefile
@@ -0,0 +1,28 @@
+# $OpenBSD$
+
+COMMENT=        the free and open-source typeface for developers
+
+DISTNAME=        JetBrainsMono-1.0.2
+CATEGORIES=        fonts x11
+
+HOMEPAGE=        https://jetbrains.com/mono/
+
+PERMIT_PACKAGE=        Yes
+
+MASTER_SITES=        https://download.jetbrains.com/fonts/
+
+BUILD_DEPENDS=        archivers/unzip
+
+NO_BUILD=        Yes
+NO_TEST=        Yes
+PKG_ARCH=        *
+
+DISTFILES=        JetBrainsMono-1.0.2.zip
+
+INST_DIR=        ${PREFIX}/share/fonts/JetBrainsMono
+
+do-install:
+    ${INSTALL_DATA_DIR} ${INST_DIR}
+    ${INSTALL_DATA} ${WRKSRC}/ttf/*.ttf ${INST_DIR}
+
+.include <bsd.port.mk>
diff --git a/fonts/jetbrains-mono/distinfo b/fonts/jetbrains-mono/distinfo
new file mode 100644
index 00000000000..47747d818da
--- /dev/null
+++ b/fonts/jetbrains-mono/distinfo
@@ -0,0 +1,2 @@
+SHA256 (JetBrainsMono-1.0.2.zip) = Wfm5di1WJetDju3wNNu83PCe0Y3tmUVAtGaHKEAil2I=
+SIZE (JetBrainsMono-1.0.2.zip) = 1986934
diff --git a/fonts/jetbrains-mono/pkg/DESCR b/fonts/jetbrains-mono/pkg/DESCR
new file mode 100644
index 00000000000..a62954621aa
--- /dev/null
+++ b/fonts/jetbrains-mono/pkg/DESCR
@@ -0,0 +1,8 @@
+JetBrains Mono. A typeface for developers
+
+ 1. Increased height for a better reading experience
+ 2. Adapted to reading code
+ 3. code-specific ligatures
+ 4. 145 languages
+ 5. weights with matching italics
+ 6. JetBrains Mono is free & open source
diff --git a/fonts/jetbrains-mono/pkg/PLIST b/fonts/jetbrains-mono/pkg/PLIST
new file mode 100644
index 00000000000..492df642d8b
--- /dev/null
+++ b/fonts/jetbrains-mono/pkg/PLIST
@@ -0,0 +1,11 @@
+@comment $OpenBSD: PLIST,v$
+share/fonts/
+@fontdir share/fonts/JetBrainsMono/
+share/fonts/JetBrainsMono/JetBrainsMono-Bold-Italic.ttf
+share/fonts/JetBrainsMono/JetBrainsMono-Bold.ttf
+share/fonts/JetBrainsMono/JetBrainsMono-ExtraBold-Italic.ttf
+share/fonts/JetBrainsMono/JetBrainsMono-ExtraBold.ttf
+share/fonts/JetBrainsMono/JetBrainsMono-Italic.ttf
+share/fonts/JetBrainsMono/JetBrainsMono-Medium-Italic.ttf
+share/fonts/JetBrainsMono/JetBrainsMono-Medium.ttf
+share/fonts/JetBrainsMono/JetBrainsMono-Regular.ttf
--
2.24.1


--
nest.cx is Gmail hosted, use PGP: https://pgp.key-server.io/0x0B1542BD8DF5A1B0
Fingerprint: 5E2B 2D0E 1E03 2046 BEC3  4D50 0B15 42BD 8DF5 A1B0

Reply | Threaded
Open this post in threaded view
|

Re: New port: JetBrainsMono fonts

Stuart Henderson
On 2020/02/02 11:18, Greg Steuck wrote:

> I tested this with emacs and xterm on amd64-current.
>
> Add JetBrainsMono fonts port
> ---
>  fonts/Makefile                 |  1 +
>  fonts/jetbrains-mono/Makefile  | 28 ++++++++++++++++++++++++++++
>  fonts/jetbrains-mono/distinfo  |  2 ++
>  fonts/jetbrains-mono/pkg/DESCR |  8 ++++++++
>  fonts/jetbrains-mono/pkg/PLIST | 11 +++++++++++
>  5 files changed, 50 insertions(+)
>  create mode 100644 fonts/jetbrains-mono/Makefile
>  create mode 100644 fonts/jetbrains-mono/distinfo
>  create mode 100644 fonts/jetbrains-mono/pkg/DESCR
>  create mode 100644 fonts/jetbrains-mono/pkg/PLIST

tars are preferred for new ports.

>
> diff --git a/fonts/Makefile b/fonts/Makefile
> index b3152654cf7..ac33b3811fb 100644
> --- a/fonts/Makefile
> +++ b/fonts/Makefile
> @@ -45,6 +45,7 @@
>       SUBDIR += ja-funetfonts
>       SUBDIR += ja-kanjistrokeorders-ttf
>       SUBDIR += ja-sazanami-ttf
> +     SUBDIR += jetbrains-mono
>       SUBDIR += jmk-fonts
>       SUBDIR += junicode
>       SUBDIR += ko-baekmuk-fonts
> diff --git a/fonts/jetbrains-mono/Makefile b/fonts/jetbrains-mono/Makefile
> new file mode 100644
> index 00000000000..088bd423deb
> --- /dev/null
> +++ b/fonts/jetbrains-mono/Makefile
> @@ -0,0 +1,28 @@
> +# $OpenBSD$
> +
> +COMMENT=        the free and open-source typeface for developers

spaces/tabs problems (unsure if that's just in the diff or in your Makefile),

"the" implies it's the only one? perhaps use something like "monospace typeface
for developers"?

> +
> +DISTNAME=        JetBrainsMono-1.0.2
> +CATEGORIES=        fonts x11
> +
> +HOMEPAGE=        https://jetbrains.com/mono/
> +
> +PERMIT_PACKAGE=        Yes

needs a license marker.

> +
> +MASTER_SITES=        https://download.jetbrains.com/fonts/
> +
> +BUILD_DEPENDS=        archivers/unzip
> +
> +NO_BUILD=        Yes
> +NO_TEST=        Yes
> +PKG_ARCH=        *
> +
> +DISTFILES=        JetBrainsMono-1.0.2.zip
> +
> +INST_DIR=        ${PREFIX}/share/fonts/JetBrainsMono
> +
> +do-install:
> +    ${INSTALL_DATA_DIR} ${INST_DIR}
> +    ${INSTALL_DATA} ${WRKSRC}/ttf/*.ttf ${INST_DIR}

rather than setting DISTFILES it should use EXTRACT_SUFX. lowercase packagename is
preferred. you could do e.g.

DISTNAME= JetBrainsMono-1.0.2
EXTRACT_SUFX= .zip
PKGNAME= ${DISTNAME:L}

or something like this so the package name matches the dir name better:

V= 1.0.2
DISTNAME= JetBrainsMono-$V
EXTRACT_SUFX= .zip
PKGNAME= jetbrains-mono-$V

Reply | Threaded
Open this post in threaded view
|

Re: New port: JetBrainsMono fonts

George Koehler-2
On Sun, 2 Feb 2020 19:52:24 +0000
Stuart Henderson <[hidden email]> wrote:

> On 2020/02/02 11:18, Greg Steuck wrote:
> > +BUILD_DEPENDS=        archivers/unzip
> > +
> > +NO_BUILD=        Yes
> > +NO_TEST=        Yes
> > +PKG_ARCH=        *
> > +
> > +DISTFILES=        JetBrainsMono-1.0.2.zip
>
> rather than setting DISTFILES it should use EXTRACT_SUFX.... lowercase packagename is
> preferred. you could do e.g.
>
> DISTNAME= JetBrainsMono-1.0.2
> EXTRACT_SUFX= .zip
> PKGNAME= ${DISTNAME:L}
>
> or something like this so the package name matches the dir name better:
>
> V= 1.0.2
> DISTNAME= JetBrainsMono-$V
> EXTRACT_SUFX= .zip
> PKGNAME= jetbrains-mono-$V

After you set 'EXTRACT_SUFX= .zip', bsd.port.mk should add an automatic
dependency on unzip, so you may delete your BUILD_DEPENDS line.
Use 'make print-build-depends' to check.

--George

Reply | Threaded
Open this post in threaded view
|

Re: New port: JetBrainsMono fonts

Greg Steuck
Thanks for the comments Stuart & George. I believe I addressed all
your comments.

I further stole from espie@'s port which simplified things a bit more.

jetbrains-mono.tgz (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: New port: JetBrainsMono fonts

George Koehler-2
On Sun, 2 Feb 2020 12:30:33 -0800
Greg Steuck <[hidden email]> wrote:

> Thanks for the comments Stuart & George. I believe I addressed all
> your comments.

I put your jetbrains-mono in /usr/ports/fonts and installed it.

As HOMEPAGE explains, this font has ligatures for
some program operators like

    ->    ++    <=

Some programs (like emacs and xfce4-terminal) don't show these
ligatures, but some (like firefox-esr and libreoffice) do.  I saw a
glitch in firefox-esr where some characters were 1 pixel too high,
but this glitch went away after I restarted the browser.

$ cat ~/Downloads/sample.html
<pre style="font-family: 'JetBrains Mono';">
if (t->t_count++ <= 5)
        puts("Cozy lummox");
</pre>

-- George

Reply | Threaded
Open this post in threaded view
|

Re: New port: JetBrainsMono fonts

Greg Steuck
On Sun, Feb 2, 2020 at 8:55 PM George Koehler <[hidden email]> wrote:
> Some programs (like emacs and xfce4-terminal) don't show these

Superficial searches indicate emacs (at least version 27) can be
taught to render ligatures.

> ligatures, but some (like firefox-esr and libreoffice) do.  I saw a
> glitch in firefox-esr where some characters were 1 pixel too high,
> but this glitch went away after I restarted the browser.
>
> $ cat ~/Downloads/sample.html
> <pre style="font-family: 'JetBrains Mono';">
> if (t->t_count++ <= 5)
>         puts("Cozy lummox");
> </pre>

This is cool! Your example renders with ligatures in Chromium too.

Thanks
Greg

Reply | Threaded
Open this post in threaded view
|

Re: New port: JetBrainsMono fonts

George Koehler-2
In reply to this post by Greg Steuck
On Sun, 2 Feb 2020 12:30:33 -0800
Greg Steuck <[hidden email]> wrote:

> Thanks for the comments Stuart & George. I believe I addressed all
> your comments.
>
> I further stole from espie@'s port which simplified things a bit more.

The fonts/jetbrains-mono from Greg Steuck on 2 Feb [1]
is ok gkoehler@ for someone else to import.

[1] https://marc.info/?l=openbsd-ports&m=158067551105582&w=2