Subject: [PATCH] gnu: Add font-adobe-source-han-code-jp.
From: Kurome <[email-masked]>
To: [email-masked]
Cc: Kurome <[email-masked]>
Date: Sun, 13 Apr 2025 23:34:41 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/fonts.scm (font-adobe-source-han-code-jp): New variable.

Change-Id: I15a3177902a4c7dd41722b174a9a154657eb81e8
---
 gnu/packages/fonts.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 85f8a5f31b..c2950cbf24 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1599,6 +1599,44 @@ (define-public font-adobe-source-code-pro
 designed to work well in user interface environments.")
     (license license:silofl1.1)))
 
+(define-public font-adobe-source-han-code-jp
+  (package
+    (name "font-adobe-source-han-code-jp")
+    (version "2.012")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/adobe-fonts/source-han-code-jp")
+             (commit (string-append version "R"))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "090q34h01ij77c7n9i6sbyfkyzdg90cwfy83z0ixc4wsy3bvycwn"))))
+    (build-system font-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; Install Only OTC (OpenType Collection), which contains all variations
+          ;; within a single file.
+          (add-before 'install 'chdir
+            (lambda _
+              (chdir "OTC")))
+          (add-after 'install 'chdir-back
+            (lambda _
+              (chdir ".."))))))
+    (home-page
+     "https://blogs.adobe.com/CCJKType/2015/06/source-han-code-jp.html")
+    (synopsis "Monospaced font for mixed Latin and Japanese text based on Source
+Han Sans and Source Code Pro")
+    (description "This package provides Source Han Code JP, a derivative of
+Source Han Sans that replaces its proportional Latin glyphs with fixed-width
+667-unit glyphs from Source Code Pro.  The Latin glyphs are scaled to match the
+Japanese kana and kanji, making the font suitable for use in programming,
+terminal applications, and user interfaces that involve both Latin and Japanese
+text.")
+    (license license:silofl1.1)))
+
 (define-public font-adobe-source-sans
   (package
     (name "font-adobe-source-sans")
-- 
2.49.0