Skip to content

Commit

Permalink
Release v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sammycage committed Apr 18, 2021
1 parent 2d6d80e commit 44aff9d
Show file tree
Hide file tree
Showing 142 changed files with 7,826 additions and 15,790 deletions.
4 changes: 0 additions & 4 deletions 3rdparty/stb/CMakeLists.txt

This file was deleted.

4,882 changes: 0 additions & 4,882 deletions 3rdparty/stb/stb_truetype.h

This file was deleted.

9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.3)

project(lunasvg VERSION 1.4.1 LANGUAGES CXX C)
project(lunasvg VERSION 2.0.0 LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_C_STANDARD 11)

option(LUNASVG_BUILD_EXAMPLES "Builds examples" OFF)
Expand All @@ -11,7 +11,6 @@ add_library(lunasvg STATIC)

add_subdirectory(include)
add_subdirectory(source)
add_subdirectory(3rdparty/stb)
add_subdirectory(3rdparty/software)
add_subdirectory(3rdparty/plutovg)

Expand All @@ -23,9 +22,7 @@ set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include/lunasvg)

install(FILES
include/svgdocument.h
include/svgelement.h
include/svgelementiter.h
include/document.h
DESTINATION ${LUNASVG_INCDIR}
)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Nwutobo Samuel Ugochukwu
Copyright (c) 2021 Nwutobo Samuel Ugochukwu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
66 changes: 32 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,65 @@
## lunasvg
# LunaSVG

lunasvg is a standalone c++ library to create, animate, manipulate and render SVG files.
lunasvg is a standalone SVG rendering library in C++

![svg2png generated PNG](luna.png)

## example
## Example

```cpp
#include <lunasvg/svgdocument.h>
#include <lunasvg/document.h>

using namespace lunasvg;

int main()
{
SVGDocument document;
document.loadFromFile("tiger.svg");

Bitmap bitmap = document.renderToBitmap();

// do something useful with the bitmap.

auto document = Document::loadFromFile("tiger.svg");
auto bitmap = document->renderToBitmap();

// do something useful with the bitmap here.

return 0;
}

```

## features
## Features

- Basic Shapes
- Document Structures
- Coordinate Systems, Transformations and Units
- SolidColors
- Gradients
- Patterns
- Masks
- ClipPaths
- Markers

- Basic Shapes : rect, circle, ellipse, line, polyline, polygon, path.
- Paint Servers : solidColor, linearGradient, radialGradient, pattern.
- Clipping, Masking and Compositing : clipPath, mask, group opacity.
- Document Structures: defs, svg, g, use, symbol.
- Coordinate Systems, Transformations and Units.
- Markers.
- Texts.
- Animations (TODO)
- Filters (TODO)
- Image (TODO)
- StyleSheet (TODO)
## TODO

## build
- Texts
- Filters
- Images
- StyleSheet

## Build

Create a build directory.
```
git clone https://github.com/sammycage/lunasvg.git
cd lunasvg
mkdir build
```
Run cmake command inside build directory.
```
cd build
cmake ..
```
Run make to build lunasvg.

```
make -j 2
```

To install lunasvg library.

```
make install
```

## demo
## Demo

While building lunasvg example it generates a simple SVG to PNG converter which can be used to convert SVG file to PNG file.

Expand All @@ -70,7 +68,7 @@ Run Demo.
svg2png [filename] [resolution] [bgColor]
```

## support
## Support

If you like the work lunasvg is doing please consider a small donation:

Expand Down
14 changes: 7 additions & 7 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
file(GLOB LUNASVG_EXAMPLE_FILES "*.cpp")
cmake_minimum_required(VERSION 3.3)

foreach(EXAMPLE_FILENAME ${LUNASVG_EXAMPLE_FILES})
get_filename_component(EXAMPLE_TARGET ${EXAMPLE_FILENAME} NAME_WE)
add_executable(${EXAMPLE_TARGET} ${EXAMPLE_FILENAME})
target_link_libraries(${EXAMPLE_TARGET} lunasvg sfml-system sfml-window sfml-graphics)
target_include_directories(${EXAMPLE_TARGET} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/../include/")
endforeach()
set(CMAKE_CXX_STANDARD 14)

project(svg2png CXX)

add_executable(svg2png svg2png.cpp)
target_link_libraries(svg2png lunasvg)
108 changes: 0 additions & 108 deletions example/clock.cpp

This file was deleted.

Loading

0 comments on commit 44aff9d

Please sign in to comment.