Skip to content
프로젝트

소개

FIG (Fortran Intuitive Graphics)

디자인 및 미디어

이 수치를 측정하는 방법

What you can do

  • Shape Drawing: Easily draw paths, shapes, and curves.
  • Styling: Apply stroking, dashing, and other styles to shapes.
  • Text Support: Render fonts and text with customizable attributes.
  • Export Options: Save your graphics in PNG, PPM, or SVG formats.

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

FIG

FIG is a Fortran library designed to offer intuitive vector graphics capabilities. It supports a variety of shapes, paths, and text, with output options including PNG, PPM, and SVG.

Features

  • Shape Drawing: Easily draw paths, shapes, and curves.
  • Styling: Apply stroking, dashing, and other styles to shapes.
  • Text Support: Render fonts and text with customizable attributes.
  • Export Options: Save your graphics in PNG, PPM, or SVG formats.

Requirements

  • A modern Fortran compiler (such as gfortran).
  • libcairo and its dependencies for rendering. Install libcairo.

Example program

Here’s a simple example to get you started:

program test_fig
   use fig
   implicit none
   type(drawing) :: canva
   type(circle) :: circ

   call canva%init()
   canva%background = FIG_COLOR_BLACK

   circ%c%x = 0.5
   circ%c%y = 0.5

   circ%r = 25
   circ%stroke_color = FIG_COLOR_TAN
   circ%fill_color = FIG_COLOR_RED
   circ%stroke_width = 3
   call canva%add_shape(circ)

   circ%r = 15
   circ%stroke_color = FIG_COLOR_CYAN
   circ%fill_color = FIG_COLOR_GRAY
   circ%stroke_width = 2
   call canva%add_shape(circ)

   ! Export the drawing to PNG and SVG formats
   call draw_to_png(canva, 100, 100, "png_test")
   call draw_to_svg(canva, 200, 300, "svg_test")

end program test_fig

result :

Note: FIG uses relative coordinates by default. To use absolute coordinates, set FIG_ABSOLUTE_COORDINATES = .true..

For a comprehensive list of shapes and their attributes, refer to the Shapes source file and Path source file.

Gallery

Below are some examples of images created using FIG.

Test All

More Examples

Radial Lines

Circles Pattern

Fortran Logo

Checker Pattern

Triangles

Cool Triangle Pattern

fpm

To use fig within your own fpm project, add the following dependency to your project fpm.toml file:

[dependencies]
fig= {git = "https://github.com/AnonMiraj/fig" }

To-Do List

  • Add support for additional backends, making cairo optional.
  • Implement gradient support.
  • Add PNG file reading capability.
  • Implement transformations (rotations, scaling, etc.).

관련 프로젝트 살펴보기

불러오는 중…