{"id":20785426,"url":"https://github.com/lieff/lvg","last_synced_at":"2025-07-06T02:39:16.213Z","repository":{"id":48141719,"uuid":"64092051","full_name":"lieff/lvg","owner":"lieff","description":"Lion Vector Graphics","archived":false,"fork":false,"pushed_at":"2022-08-16T14:30:02.000Z","size":16591,"stargazers_count":123,"open_issues_count":3,"forks_count":14,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T21:51:16.508Z","etag":null,"topics":["cross-platform","flash","gles","gles2","opengl","opengl-es","small-size-league","svg","swf","tiny","vector","web","webgl"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lieff.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}},"created_at":"2016-07-25T00:31:13.000Z","updated_at":"2025-03-20T14:03:32.000Z","dependencies_parsed_at":"2022-08-29T03:01:10.264Z","dependency_job_id":null,"html_url":"https://github.com/lieff/lvg","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lieff%2Flvg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lieff%2Flvg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lieff%2Flvg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lieff%2Flvg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lieff","download_url":"https://codeload.github.com/lieff/lvg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252516283,"owners_count":21760750,"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","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":["cross-platform","flash","gles","gles2","opengl","opengl-es","small-size-league","svg","swf","tiny","vector","web","webgl"],"created_at":"2024-11-17T14:45:36.836Z","updated_at":"2025-05-05T14:43:07.009Z","avatar_url":"https://github.com/lieff.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"LVG (Lion Vector Graphics)\n==========\n\n[![Build Status](https://travis-ci.org/lieff/lvg.svg)](https://travis-ci.org/lieff/lvg)\n[![CircleCI](https://circleci.com/gh/lieff/lvg.svg?style=svg)](https://circleci.com/gh/lieff/lvg)\n[![Build Status](https://ci.appveyor.com/api/projects/status/69br8ic9dwlfeu48?svg=true)](https://ci.appveyor.com/project/lieff/lvg)\n\u003ca href=\"https://scan.coverity.com/projects/lieff-lvg\"\u003e\n  \u003cimg alt=\"Coverity Scan Build Status\"\n       src=\"https://scan.coverity.com/projects/14454/badge.svg\"/\u003e\n\u003c/a\u003e\n\nLVG is a lightweight flash player replacement. Basic idea: we have some assets in a package and sctipts that renders them.\nIt's designed to use a very small runtime (around 200kb without video codecs) for player and runs on android, ios, web and more.\n\nCurrently it uses C script to load and render assets.\nWhy C script? Because C compiler is small, and runtime written in C, so no other language is needed and script can be compiled in to a save the space.\nAnother reason is compatibility: lvg only exposes small API and opengl, with other scripting laguages we must do all from scratch, including GUI.\nBut there are huge amount of already-written C code.\nUsually author prefer C++, but there also some reasons to use pure C for whole project:\n\n * We do not need to include libstdc++ for Android shared objects, which saves some .apk space (shared objects libs also usually duplicated for each supported architectue in .apk).\n * This reduces size of emscripten compiled WASM code (it's already relatively heavy).\n * Native C++ builds needs some attention for small code too. It's definetly possible to write small code with C++, but we need something like minicrt for each platform/compiler. See [farbrauch](https://github.com/farbrausch/fr_public) code for example or something similar.\n * C++ code produces much more noisy .map files which makes profile/map file analysis bit more complicated. Projects like chromium also uses objects analysis tools (like dump-static-initializers.py), there also less noise with such tools.\n * Code can be ported to specific OS'es more easily.\n\nFollowing assets currently supported:\n\n * SVG vector images (loaded using [NanoSVG](https://github.com/memononen/nanosvg))\n * Raster images (loaded using [stb_image.h](https://github.com/nothings/stb))\n * MP3 files (loaded using [minimp3](https://github.com/lieff/minimp3))\n * Flash SWF files (can contain vector, raster, video and audio). All swf video codecs (h263,vp6,flashsv,flashsv2,h264) costs additional ~600kb.\n * Scripts using [tcc](https://bellard.org/tcc/) or [picoc](https://gitlab.com/zsaleeba/picoc)\n\nRender can be done using following backends:\n\n * [NVIDIA Path Rendering](https://developer.nvidia.com/nv-path-rendering)\n * [NanoVG](https://github.com/memononen/nanovg)\n\n## Current Status\n\nWorks:\n\n * SVG, image, mp3 resources with tcc scripting.\n * SWF: shapes, images, video, audio (mp3, adpcm, pcm), limited action script 2 support, limited morph shapes support.\n\nNot works:\n\n * SWF: clip layers\n * SWF: interpret action script 3\n * SWF: bitmap filters\n * SWF: network access\n\n## Demos\n\nBasic svg demo (images clickable):\n\n[![SVG Screenshot](images/svg_tiger.png?raw=true)](https://lieff.github.io/lvg_player.html?file=test.lvg)\n\nNanoVG demo incapsulated in lvg:\n\n[![NanoVG Screenshot](images/nanovg.png?raw=true)](https://lieff.github.io/lvg_player.html?file=test_nanovg.lvg)\n\nNuklear GUI demo:\n\n[![Nuklear Screenshot](images/nuklear.png?raw=true)](https://lieff.github.io/lvg_player.html?file=test_nuklear_gles2.lvg)\n\nFlash swf demo:\n\n[![Flash Screenshot](images/kitty.png?raw=true)](https://lieff.github.io/lvg_player2.html?file=npc_kitty_chicken.swf)\n\n## Building\n\nFor now windows executables builds only on linux host using [mingw](https://mingw-w64.org/).\nFor windows and linux install all build dependencies with the following command:\n\n```\napt-get install -qq -y git cmake meson yasm libglfw3-dev libsdl2-dev libavcodec-dev mingw-w64 wget\n```\n\nFor macos brew must be installed:\n\n```\nbrew install meson upx glfw sdl2 ffmpeg tcc\n```\n\nLVG uses meson as build system. Actual building with the following commands in project directory:\n\n```\nmkdir build\ncd build\nmeson ..\nninja\n```\n\n## Configuring\n\nLVG can be configured to use different backends for platform, audio and video. You can see current configuration by executing mesonconf (or meson configure for newer meson versions) in build directory:\n\n```\nmeson configure\n...\nProject options:\n  Option        Description   Current Value Possible Values\n  ------        -----------   ------------- ---------------\n  AUDIO_SDL     AUDIO_SDL     true          [True, False]\n  ENABLE_AUDIO  ENABLE_AUDIO  true          [True, False]\n  ENABLE_SCRIPT ENABLE_SCRIPT true          [True, False]\n  ENABLE_VIDEO  ENABLE_VIDEO  true          [True, False]\n  PLATFORM_GLFW PLATFORM_GLFW true          [True, False]\n  PLATFORM_SDL  PLATFORM_SDL  false         [True, False]\n  RENDER_NANOVG RENDER_NANOVG true          [True, False]\n  RENDER_NVPR   RENDER_NVPR   true          [True, False]\n  SCRIPT_TCC    SCRIPT_TCC    true          [True, False]\n  VIDEO_FFMPEG  VIDEO_FFMPEG  true          [True, False]\n...\n```\n\nYou can change configuration using meson commands. Example:\n\n```\nmesonconf -DENABLE_SCRIPT=False\n```\n\n## Future\n\n * Use other scripting lanuages like [luajit](http://luajit.org/), [JerryScript](https://github.com/jerryscript-project/jerryscript), [muJS](http://artifex.com/mujs/), [mu](https://github.com/geky/mu), [avian](https://readytalk.github.io/avian/), [ImpalaJIT](https://github.com/Manuel1605/ImpalaJIT), [mochascript](https://github.com/Piot/mochascript) and [AngelScript](http://angelcode.com/angelscript/).\n * Speed up action script with jit like [sljit](http://sljit.sourceforge.net/).\n * Shaders and 3D support.\n * Parallel shape\\image decoding and use file compression with parallel decoding support (like pbzip2).\n * More audio\\video\\codec backends.\n * ~~SWF frame interpolation to get more fps than encoded in file.~~ [Done]\n * Better than swf storage format using [draco](https://github.com/google/draco)-like compression based on [ANS](https://en.wikipedia.org/wiki/Asymmetric_numeral_systems).\n\n## Interesting graphics libraries\n\n * https://github.com/01org/fastuidraw\n * https://skia.org/\n * https://github.com/blend2d/blend2d/\n * https://github.com/memononen/nanovg\n * https://github.com/mokafolio/Tarp\n * https://github.com/jpbruyere/vkvg\n * https://github.com/jdryg/vg-renderer\n * https://github.com/nical/lyon\n * https://cairographics.org/\n * http://www.antigrain.com/\n * http://scripts.sil.org/cms/scripts/page.php?site_id=projects\u0026item_id=graphite_home\n * https://sourceforge.net/projects/shivavg/\n * https://github.com/micahpearlman/MonkVG\n * https://github.com/KhronosGroup/OpenVG-Registry\n\n## Flash related projects\n\n * https://github.com/lightspark/lightspark\n * https://github.com/mozilla/shumway\n * https://github.com/ruffle-rs/ruffle\n * https://www.gnu.org/software/gnash/\n * https://swfdec.freedesktop.org/wiki/\n * https://github.com/marmalade/gameswf\n * http://tulrich.com/geekstuff/gameswf.html\n * http://www.swftools.org/\n * http://www.libming.org/\n * http://www.swift-tools.net/Flash/\n * https://github.com/crossbridge-community/crossbridge\n * SWF v19 reference https://wwwimages2.adobe.com/content/dam/acom/en/devnet/pdf/swf-file-format-spec.pdf\n * AMF v0 referemce https://wwwimages2.adobe.com/content/dam/acom/en/devnet/pdf/amf0-file-format-specification.pdf\n * AMF v3 reference https://wwwimages2.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf\n * AS2 reference http://homepage.divms.uiowa.edu/~slonnegr/flash/ActionScript2Reference.pdf\n\nLVG is developed and maintained by https://github.com/lieff\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flieff%2Flvg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flieff%2Flvg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flieff%2Flvg/lists"}