From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by sourceware.org (Postfix) with ESMTPS id EBA28388551A for ; Wed, 26 Oct 2022 20:22:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EBA28388551A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-xe30.google.com with SMTP id q127so10713371vsa.7 for ; Wed, 26 Oct 2022 13:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=inNMa+A0yJHP+bBS69/4v37cB/Cnzkb9FxR2c0CWmI0=; b=EfgVwCqWpfHxtxed78EYeThSB3BF9r+vQwW/rjJC/BARuhssKxPFwlB8+1yhNWLEyf cf/R31yu9znCrNYNlew+JVzIluoG0+0ruj00X7jDEvnmS4eMfh9+2OfMnHs7eLg4E17Z I5yGBrwP4ex8U6XGPOls6opBsIES5xywDq2hKE+WcAAYfK0OgLldyyjafKHbMDanZV4X ZChMR76TP1E4yqQivb9Ww6LEQkTURvyDMItVdCCMLxDUp4k7ensxjqm9h3teeMorbBL0 D84bHifteCWivUa0+RXzZ+5v56oTPKB/6ngPfek37RLQzLdOv4+m9DRSly6FgafEKBcJ nYZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=inNMa+A0yJHP+bBS69/4v37cB/Cnzkb9FxR2c0CWmI0=; b=ektpae7sN3tmUEQewNwp4puyUV1CWel17Cdes7pQH2OWvatKjMsZSVMzD//9cgo63/ yxFQ/WWfbfaXJczu7JuEZfR0XLiquVUVCxmFMhT7kSQ2FQWPOEpeGj0XFlll6QureU7z iDDKawbD2PYowdiPNuvPxXUD0rh+Meohn70bFf3cNTO0wflvu6Vp4oETcc6RYMtsKgS5 Q9+TQKEXjJpm7GJF2kvFDnhfqUCd/L220+M/648w7KtjpsWQ3bBNwigd9p2xj+z9b5Z/ oGIHTZ5q/HJFKB32LCT4xYdLl+E3ONiwvFlyTCpNZpLVolWRvzCNAhdYVh+TlaZ4ueq7 2Log== X-Gm-Message-State: ACrzQf1nlVzSM3lIgKm5PaQvwfCPLaGBoYjm2eyxxN60l64YeW55onkD lK86n6F71bIm6DP7TeiUY1TT7nQQnewRafBjilPo26fw X-Google-Smtp-Source: AMsMyM5zD0g64bNMxJRSBj6Y7uWVY7oKvSLDIT4dP3HLp6TibXjEsRPAgfXKG0iBmoYGhtzk3JZRtGgO/etxe25wWI4= X-Received: by 2002:a67:efc2:0:b0:3aa:30c4:a9ca with SMTP id s2-20020a67efc2000000b003aa30c4a9camr7529422vsp.0.1666815729880; Wed, 26 Oct 2022 13:22:09 -0700 (PDT) MIME-Version: 1.0 From: Panicz Maciej Godek Date: Wed, 26 Oct 2022 22:21:58 +0200 Message-ID: Subject: Problem reading font data. To: kawa@sourceware.org Content-Type: multipart/alternative; boundary="0000000000007c512505ebf5c7a7" X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --0000000000007c512505ebf5c7a7 Content-Type: text/plain; charset="UTF-8" I have the following code (it doesn't require graphics environment to run): (define-alias Font java.awt.Font) (define-alias InputStream java.io.InputStream) (define ClassLoader ::java.lang.ClassLoader (java.lang.ClassLoader:getSystemClassLoader)) (define the-graphics-environment ::parameter[java.awt.GraphicsEnvironment] (make-parameter (invoke-static java.awt.GraphicsEnvironment 'getLocalGraphicsEnvironment))) (define (load-font path::String #!key (size ::float 12.0)) (let* ((font-source ::InputStream (ClassLoader:getResourceAsStream path)) (font ::Font (Font:createFont Font:TRUETYPE_FONT font-source))) (invoke (the-graphics-environment) 'registerFont font) (font:deriveFont size))) (define-constant Basic-Regular (load-font "assets/Basic-Regular.otf" size: 20) The Basic-Regular.orf file is present in the assets directory, located in the same directory as the above file (that I called font-test.scm. When I run the code with $ kawa -f font-test.scm it behaves well. But when I instead use $ java -jar /path/to/kawa.jar -f font-test.scm or $ java -cp /path/to/kawa.jar kawa.repl -f font-test.scm I get the following error: java.io.IOException: Problem reading font data. at java.desktop/java.awt.Font.createFont0(Font.java:1208) at java.desktop/java.awt.Font.createFont(Font.java:1076) at atInteractiveLevel$Mn8.loadFont$check(font-test.scm:21) at gnu.mapping.CallContext.runUntilValue(CallContext.java:656) at atInteractiveLevel$Mn9.run(font-test.scm:27) at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290) at kawa.Shell.run(Shell.java:300) at kawa.Shell.runFile(Shell.java:562) at kawa.Shell.runFileOrClass(Shell.java:485) at kawa.repl.processArgs(repl.java:298) at kawa.repl.main(repl.java:830) I even went so far to modify the `which kawa` script by inserting "set -x" in the first line following the she-bang: + KAWALIB=/data/data/com.termux/files/home/usr/share/kawa/lib/kawa.jar + CLASSPATH=/data/data/com.termux/files/home/usr/share/kawa/lib/kawa.jar:/data/data/com.termux/files/usr/share/java/android.jar: + export CLASSPATH + test -n /data/data/com.termux/files/usr/opt/openjdk + JAVA=/data/data/com.termux/files/usr/opt/openjdk/bin/java + JVM_FLAGS= + exec /data/data/com.termux/files/usr/opt/openjdk/bin/java -Dkawa.command.line=/data/data/com.termux/files/home/usr/bin/kawa -f font-test.scm -Dkawa.command.pid=20316 -Dkawa.home=/data/data/com.termux/files/home/usr/share/kawa kawa.repl -f font-test.scm So - in orded to minimize the differences, I typed the following incantation: $ KAWALIB=/data/data/com.termux/files/home/usr/share/kawa/lib/kawa.jar CLASSPATH=/data/data/com.termux/files/home/usr/share/kawa/lib/kawa.jar /data/data/com.termux/files/usr/opt/openjdk/bin/java -Dkawa.command.line="/data/data/com.termux/files/home/usr/bin/kawa -f font-test.scm" -Dkawa.home=/data/data/com.termux/files/home/usr/share/kawa kawa.repl -f font-test.scm But that still doesn't work. Does anyone know what could be the difference between these two runtime environments? (I checked, and they both report the same value of (current-path)) --0000000000007c512505ebf5c7a7--