Skip to content
プロジェクト

概要

FIG (Fortran Intuitive Graphics)

デザイン・メディア

この数値の測り方

できること

  • 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.

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

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.).

関連プロジェクトを探す

読み込み中…