This repository has been archived by the owner on Jun 4, 2019. It is now read-only.
/
draw_common.ml
53 lines (46 loc) · 1.65 KB
/
draw_common.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(*s: draw_common.ml *)
(*s: Facebook copyright *)
(* Yoann Padioleau
*
* Copyright (C) 2010-2012 Facebook
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation, with the
* special exception on linking described in file license.txt.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file
* license.txt for more details.
*)
(*e: Facebook copyright *)
open Common
open Common.ArithFloatInfix
module CairoH = Cairo_helpers
(*****************************************************************************)
(* Prelude *)
(*****************************************************************************)
(*****************************************************************************)
(* Anamorphic entities *)
(*****************************************************************************)
(*s: final_font_size_when_multiplier *)
let final_font_size_when_multiplier
~multiplier ~size_font_multiplier_multiplier
~font_size ~font_size_real
=
let size_font_multiplier = multiplier in
let font_size_adjusted =
if size_font_multiplier = 1.
then font_size
else
max
(font_size * size_font_multiplier * size_font_multiplier_multiplier)
(font_size * 1.5)
in
let final_font_size =
Common.borne ~min:font_size ~max:(font_size * 30.) font_size_adjusted
in
final_font_size
(*e: final_font_size_when_multiplier *)
(*e: draw_common.ml *)