{"id":30594814,"url":"https://github.com/harfbuzz/luaharfbuzz","last_synced_at":"2025-08-29T20:09:47.703Z","repository":{"id":46229308,"uuid":"47167683","full_name":"harfbuzz/luaharfbuzz","owner":"harfbuzz","description":"Harfbuzz bindings for Lua","archived":false,"fork":false,"pushed_at":"2025-08-02T18:52:44.000Z","size":1206,"stargazers_count":11,"open_issues_count":6,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-08-18T00:35:23.216Z","etag":null,"topics":["harfbuzz","lua","luarocks"],"latest_commit_sha":null,"homepage":"https://github.com/harfbuzz/luaharfbuzz/wiki","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harfbuzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-12-01T05:28:03.000Z","updated_at":"2025-08-02T18:50:48.000Z","dependencies_parsed_at":"2025-08-02T09:46:13.871Z","dependency_job_id":"ec9bb9c2-ffcb-4044-bd61-566524995035","html_url":"https://github.com/harfbuzz/luaharfbuzz","commit_stats":null,"previous_names":["harfbuzz/luaharfbuzz"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/harfbuzz/luaharfbuzz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harfbuzz%2Fluaharfbuzz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harfbuzz%2Fluaharfbuzz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harfbuzz%2Fluaharfbuzz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harfbuzz%2Fluaharfbuzz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harfbuzz","download_url":"https://codeload.github.com/harfbuzz/luaharfbuzz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harfbuzz%2Fluaharfbuzz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272757179,"owners_count":24988012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["harfbuzz","lua","luarocks"],"created_at":"2025-08-29T20:09:45.992Z","updated_at":"2025-08-29T20:09:47.694Z","avatar_url":"https://github.com/harfbuzz.png","language":"C","readme":"[![Build + Deploy](https://github.com/harfbuzz/luaharfbuzz/actions/workflows/ci.yml/badge.svg)](https://github.com/harfbuzz/luaharfbuzz/actions/workflows/ci.yml)\n\n# _luaharfbuzz_\n\nLua bindings for [Harfbuzz].\n\n[Harfbuzz]:http://harfbuzz.org\n\n## Contents\n\n* [Overview](#overview)\n* [Installing Harfbuzz](#installing-harfbuzz)\n* [Installing _luaharfbuzz_](#installing-luaharfbuzz)\n* [Documentation](#documentation)\n* [Sample Code](#sample-code)\n* [Development](#development)\n* [Contact](#contact)\n\n## Overview\nHarfBuzz is an OpenType text shaping engine. It is used in software like Qt,\nPango, Firefox, Chromium, XeTeX and LibreOffice.\n\n_luaharfbuzz_ provides bindings for the most common types in Harfbuzz. The\ninitial motivation for building it was to use Harfbuzz with the [LuaTeX]\ntypesetting system. However, the module isn’t tied to LuaTeX. It\ncan be used with any Lua codebase.\n\nAs of 2020, luaharfbuzz is bundled with [LuaTeX]. Additional support to use\nthe HarfBuzz renderer with LuaLaTeX and other formats is available via [luaotfload]. Read more:\n\n* [TUG 2020 — Marcel Krüger — HarfBuzz in LuaLaTeX](https://www.youtube.com/watch?v=xPj6vNo8exY\u0026t=2120s)\n* [Typesetting Bangla script with LuaLaTeX](http://tug.org/TUGboat/tb41-1/tb127fischer-bangla.pdf)\n* [Bringing world scripts to LuaTeX: The HarfBuzz experiment](https://tug.org/TUGboat/tb40-1/tb124hosny-harfbuzz.pdf)\n\n[LuaTeX]:luatex.org\n[luaotfload]: https://github.com/latex3/luaotfload\n\n## Installing Harfbuzz\n\nMake sure [Harfbuzz] libraries and headers are installed. before trying to\ninstall _luaharfbuzz_\n\n#### OS X\n\nInstall via [Homebrew](http://brew.sh/)\n\n```\nbrew install harfbuzz\n```\n#### Ubuntu Linux\n\n```\napt-get install libharfbuzz0b libharfbuzz-dev\n```\n\n#### Other Platforms\n_Send a pull request if you want to include specific instructions to install\nHarfbuzz on your preferred platform._\n\nBefore building the package, LuaRocks populates the `HARFBUZZ_INCDIR` and `HARFBUZZ_LIBDIR` to point to the correct locations. If you can populate these variables manually before running LuaRocks, you can install _luaharfbuzz_ on any system that supports Lua and Harfbuzz.\n\n## Installing _luaharfbuzz_\n\n#### Luarocks\nIf [Luarocks] and Harfbuzz are installed, _luaharfbuzz_ can be installed like this:\n\n```\nluarocks install luaharfbuzz\n```\n\n[Luarocks]: https://luarocks.org\n\n## Documentation\n* [API Docs](http://harfbuzz.github.io/luaharfbuzz/)\n* [Wiki](http://github.com/harfbuzz/luaharfbuzz/wiki)\n\n## Sample Code\n\nHere is some sample code, showcasing the core types and methods in the API.\n\n```lua\nlocal harfbuzz = require('harfbuzz')\nlocal serpent  = require('serpent') -- luarocks install serpent\n\n-- Harfbuzz API Version\nprint(\"Harfbuzz API version\", harfbuzz.version())\n\n-- Shapers available\nprint(\"Shapers:\", serpent.line({ harfbuzz.shapers() }, {comment = false}))\n\n-- harfbuzz.Face\nlocal face = harfbuzz.Face.new('../fonts/notonastaliq.ttf')\nprint('\\nFace upem = '..face:get_upem())\n\n-- harfbuzz.Font\nlocal font = harfbuzz.Font.new(face)\nlocal xs, xy = font:get_scale()\nprint(\"\\nDefault font scale = X: \"..xs..\", Y: \"..xy)\n\n-- harfbuzz.Buffer\nlocal text = \"یہ\" -- U+06CC U+06C1\nlocal buf = harfbuzz.Buffer.new()\nbuf:add_utf8(text)\n\n-- harfbuzz.shape (Shapes text)\nprint(\"\\nShaping '\"..text..\"' set with Noto Nastaliq Urdu\")\nharfbuzz.shape(font, buf, { language = harfbuzz.Language.new(\"urd\"), script = harfbuzz.Script.new(\"Arab\"), direction = harfbuzz.Direction.RTL})\n\nlocal glyphs = buf:get_glyphs()\nprint(\"No. of glyphs\", #glyphs)\nprint(serpent.line(glyphs, {comment = false}))\n\nlocal opts = { language = harfbuzz.Language.new(\"eng\"), script = harfbuzz.Script.new(\"Latn\"), direction = harfbuzz.Direction.LTR }\nlocal amiri_face = harfbuzz.Face.new('../fonts/amiri-regular.ttf')\nlocal amiri_font = harfbuzz.Font.new(amiri_face)\n\n-- shaping '123' w/o features\nprint(\"\\nShaping '123' set with Amiri Regular and no features\")\nbuf= harfbuzz.Buffer.new()\nbuf:add_utf8(\"123\")\nharfbuzz.shape(amiri_font, buf, opts)\nglyphs = buf:get_glyphs()\nprint(serpent.line(glyphs, {comment = false}))\n\n-- shaping '123' with '+numr' (numerators)\nprint(\"\\nShaping '123' set with Amiri Regular with 'numr' feature turned on\")\nbuf= harfbuzz.Buffer.new()\nbuf:add_utf8(\"123\")\nopts.features = \"+numr\"\nharfbuzz.shape(amiri_font, buf, opts)\nglyphs = buf:get_glyphs()\nprint(serpent.line(glyphs, {comment = false}))\n```\n\n## Development\n\n#### Building\nYou can build the package for development purposes using LuaRocks as well. It is recommended that you build it to your local tree (using `--local`) to isolate it from your actual installation. For convenience, you can use `make`:\n\n```\nmake build\n```\n\n#### Testing and Linting\nIn order to make changes to the code and run the tests, the following dependencies need to be installed:\n\n* [Busted](http://olivinelabs.com/busted/) – `luarocks install busted`\n* [luacheck](luacheck.readthedocs.org) – `luarocks install luacheck`\n* [ldoc](https://stevedonovan.github.io/ldoc/) – `luarocks install ldoc`\n\nRun the test suite:\n```\nmake test\n```\n\nLint the codebase:\n```\nmake lint\n```\n\nGenerate documentation from sources:\n```\nmake doc\n```\n\n## Contact\nOpen a Github issue, or email me at \u003cdeepak.jois@gmail.com\u003e.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharfbuzz%2Fluaharfbuzz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharfbuzz%2Fluaharfbuzz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharfbuzz%2Fluaharfbuzz/lists"}