From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NO_RECEIVED,NO_RELAYS, T_SCC_BODY_TEXT_LINE,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/118052 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Max Chernoff Newsgroups: gmane.comp.tex.context Subject: lpdf.registerfontmethod Date: Thu, 06 Jul 2023 20:51:35 -0600 Message-ID: <31d1664581869deb44737ccc701cd6af601bb1f2.camel@telus.net> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2749"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) To: ntg-context Archived-At: Original-X-From: ntg-context-bounces+gctc-ntg-context-518=m.gmane-mx.org@ntg.nl Fri Jul 07 04:53:34 2023 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from cgl.ntg.nl ([5.39.185.202]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qHbbC-0000ay-2w for gctc-ntg-context-518@m.gmane-mx.org; Fri, 07 Jul 2023 04:53:34 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 05A9F482657 for ; Fri, 7 Jul 2023 04:52:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Original-Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dd6DYwFxLKZ4 for ; Fri, 7 Jul 2023 04:52:18 +0200 (CEST) Original-Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 245D34824CD for ; Fri, 7 Jul 2023 04:51:55 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id B86F7481ED4 for ; Fri, 7 Jul 2023 04:51:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Original-Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s62q_Fe1sQ0a for ; Fri, 7 Jul 2023 04:51:40 +0200 (CEST) Original-Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 6521A481EC2 for ; Fri, 7 Jul 2023 04:51:40 +0200 (CEST) Original-Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-1b06777596cso1332522fac.2 for ; Thu, 06 Jul 2023 19:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=google; t=1688698298; x=1691290298; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:from:to:cc:subject:date:message-id:reply-to; bh=c9BhOFps80TIkwQqy/DGOzKruitVOFwhB9a0T3RkKTg=; b=D/+Bi92aqm3pUh/wYt7sdx9OGIxxmHCpKIcUDOr0gz+4rQ7zXcsXL9eVBi4628/nPr Db8sTKc7zxHrB+0afG0X/LlplwinsfolgpCti4cD9WKNjYxatWA/ex5ipg8cn4krmfFI JUHknJvmdye43G6nAtkfrnLmCQw/7NJc3RxrcRgyY2d3PBVkkWrJtqWk4kSyGN+oS2L1 o5rgNwe1Oxrk2K1Gw0sEhhTLH+f7Qp2FoJU0jPtCANhSY/GdHlfl9WR0Y9rndS7ZRPPW FcGB9ZHQX1Q7vcXYgnrZr4a8u/bdtb9zn2O02xhd3NwdqdcKZsKprMer/H9c5XnXPyM+ PTMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688698298; x=1691290298; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=c9BhOFps80TIkwQqy/DGOzKruitVOFwhB9a0T3RkKTg=; b=Fsv/jmciSYXG7RwOm5epqT5VBZtyxBm0pBBjDbIaX5kXdb98kzFtZd+4wBIzusmIok oWQmhV7EoUczrkBqHsKluVGe6yAS/VgfSzpw0EhWoBlwPdMAoTDyXHG8ZC8La16RFCbT ip5JIoAWu5o8j1rF/MEdevMRzlTm+K8mIAasy0IYnpEeUPRza9fnmLbI0U2TUXJrhrif Zea9EPyQoaTNgOKSV1BmsgjeyNGmX4FZYdpy0J2Wl1Tiqn9d9NN9WLYMXYPGWrFoI49K S+4gTAdRXCIrtoeGpGCfXOp4EV/USE95rU0H1aWy9YYNip0RKDw4tJcrUhWqqeKbBBeJ ddyQ== X-Gm-Message-State: ABy/qLbVcjY8lkLaJnfgFUvpRh0rC7Lo28sp6zM/0b30MjKUMX8JfZRo G8PxN9/BmuRRjfhY/v9wMx5E+GcvL6NXISzVwLU= X-Google-Smtp-Source: APBJJlEo2ipO3O7Dc0qE0wATBjvFAEiWfb0czuWy2AkleZoseUGG4Zhbd9vAMDEX/+au9mVwNqb49Q== X-Received: by 2002:a05:6870:8291:b0:1b3:e267:68ab with SMTP id q17-20020a056870829100b001b3e26768abmr4592869oae.53.1688698296955; Thu, 06 Jul 2023 19:51:36 -0700 (PDT) Original-Received: from ?IPv6:2001:56a:7259:8f00::527? ([2001:56a:7259:8f00::527]) by smtp.gmail.com with ESMTPSA id 8-20020a17090a08c800b00263e4dc33aasm430582pjn.11.2023.07.06.19.51.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 19:51:36 -0700 (PDT) Message-ID-Hash: V2H7GUB2LK7UNLKJXHL3NOK2CPSQFYXV X-Message-ID-Hash: V2H7GUB2LK7UNLKJXHL3NOK2CPSQFYXV X-MailFrom: mseven@telus.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: mailing list for ConTeXt users List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Xref: news.gmane.io gmane.comp.tex.context:118052 Archived-At: Hi Hans, In lpdf-emb.lmt, there's a commented-out definition of lpdf.registerfontmethod that I'd like to use. I've uncommented this in my installation and it's worked pretty well for me, so can you please uncomment/enable this by default in the distribution? If you want further background, this is how I'm using it: lpdf.registerfontmethod("rawpdf", function(filename, details) return details.properties.indexdata[1], 0.001, function(char) return char.code, char.width / t3_to_sp end, function() end, function() end end) local function make_glyph(codepoint, unicode, width, height, code) local spec = { width = width * t3_to_sp, height = height * t3_to_sp, depth = 0, unicode = { utf8.codepoint(unicode or "", 1, -1, true) }, code = width .. " 0 d0 " .. code, } local tfmdata = fonts.hashes.identifiers[font.current()] tfmdata.characters[codepoint] = spec fonts.dropins.swapone( "rawpdf", tfmdata, { code = spec }, codepoint ) fonts.constructors.addcharacters( font.current(), { characters = { [codepoint] = spec } } ) end I specifically need something that writes out a raw PDF stream. I'm using this to write a 4000+ page PDF file to be included by pdfTeX, so I can't have any XObject indirection or similar, otherwise the number of objects skyrockets and pdfTeX (+qpdf) gets really slow. If you're curious, the actual code where I'm using this is here: https://github.com/gucci-on-fleek/unnamed-emoji/blob/master/source/svg-to-pdf.cld https://github.com/gucci-on-fleek/unnamed-emoji/blob/master/source/unnamed-emoji.lua I know that what I'm doing in the .cld file is wildly unsupported, but I'm the only one who will ever need to run that. I am planning on distributing the .lua file though, so I'd like to get this change in the distribution. I'm also open to using a different interface instead if you don't want to publicly-expose lpdf.registerfontmethod. Thanks, -- Max ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________