Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander K committed Feb 23, 2024
1 parent b316a7f commit ea75499
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 6 deletions.
98 changes: 96 additions & 2 deletions Days.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require 'date'
require_relative 'bs/all'
END { Days.make name: 'Days_DOT', grid: ?G } if __FILE__ == $0
END { Days.make name: 'Days_focus', grid: ?g, focus: true } if __FILE__ == $0

# - [ ] link back from habits back at the same invisible position
# could be another use somewhere else

# Month names alignment may feel a bit chaotic but I use the principle of blank slate upper-left corner for writing

Expand All @@ -11,7 +14,7 @@
module Days
YEAR = 2024

def self.make name:, grid:
def self.make name:, grid: , focus: false
#####

path = File.join __dir__, 'output'
Expand Down Expand Up @@ -94,6 +97,92 @@ def self.make name:, grid:
}
end

number_mapping = {
}
num_i = 1
'Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ'.chars.each { |c|
next if c =~ /\s/
p [num_i, c]
number_mapping[num_i.to_s] = c
num_i += 1
}
have = -> x, y, text {
text = number_mapping[text] || text

x *= 0.5
y *= 0.5

at = Pos[x, y].up 0.5
pos = $bs.g.at at

size = $bs.g.xs.step*0.5

$bs.omg_text_at pos, text, centering: 0.25, size: size, align: :center,
font_is: $ao, size2: size * 0.6
}
have_numbers = -> {
have.call 11+7, 11, '4'
have.call 11+1, 11, '5'
have.call 11, 11, '6'
have.call 11-6, 11, '7'

have.call 11+7, 24, '1'
have.call 11+1, 24, '12'
have.call 11, 24, '11'
have.call 11-6, 24, '10'

have.call 11-6, 11+6, '8'
have.call 11-6, 11+7, '9'

have.call 11+7, 11+7, '2'
have.call 11+7, 11+6, '3'
}


focus_bg = BS::Group.new
w = 1 #0.5
c = 0

one = BS::LinesGrid.new
one.xs 0, 3
one.ys *5.times.map { |i| 15 - i * 3 }
one.width = w
one.color = c
focus_bg.push one

one = BS::LinesGrid.new
one.xs 12-0, 12-3
one.ys *5.times.map { |i| 15 - i * 3 }
one.width = w
one.color = c
focus_bg.push one

one = BS::LinesGrid.new
one.xs 6
one.x_range 3, 9
one.ys 12, 15
one.width = w
one.color = c
focus_bg.push one

one = BS::LinesGrid.new
one.xs 6
one.x_range 3, 9
one.ys 3, 6
one.width = w
one.color = c
focus_bg.push one

one = BS::LinesGrid.new
one.xs 6
one.x_range 6-0.5, 6+0.5
one.ys 9
one.y_range 9-0.5, 9+0.5
one.width = w
one.color = c
focus_bg.push one


months = {}

BS.xs(:month).each_with_index { |pg, i|
Expand All @@ -103,6 +192,11 @@ def self.make name:, grid:
month.generate do
page.tag = :day
draw_grid.call bg.take
focus_bg.render_lines
have_numbers.call

if focus
end

omg = page[:"m_#{i}_square"]
day_d = Date.new YEAR, d.month, omg.day
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PDFs for RM.

# Where

- [Days_focus.pdf has predefined background with hour blocks](https://github.com/sowcow/blank_slate_pdf/releases/latest/download/Days_focus.pdf)
- [Days.pdf random background version](https://github.com/sowcow/blank_slate_pdf/releases/latest/download/Days_MIX.pdf)
- [Projects.pdf](https://github.com/sowcow/blank_slate_pdf/releases/latest/download/Projects.pdf)
- [Index.pdf random background version](https://github.com/sowcow/blank_slate_pdf/releases/latest/download/Index_MIX.pdf)
Expand Down Expand Up @@ -70,6 +71,13 @@ There are some hidden features:
- hidden links below upper corners that lead from Day view to Week view
- also less intuitive links from Month view to Week view are positioned right below every column of days

Also there is a predefined background version where center suqare can be used as:
- Focus of the day
- Eisenhower matrix in four parts
- Sketch built over the day
- Mix of these
- Bottom space is probably catchall/followup then (unless another tool does it)

![Structure overview](output/COLOR_Days_MIX.png?raw=true)

# Projects PDF
Expand Down
3 changes: 3 additions & 0 deletions bs/fonts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
$roboto_light = path.call './fonts/Roboto/Roboto-Light.ttf'
#$roboto_thin = path.call './fonts/Roboto/Roboto-Thin.ttf'
#$roboto_bold = path.call './fonts/Roboto/Roboto-Bold.ttf'

# roman literals in Days.pdf
$ao = path.call './fonts/AoboshiOne-Regular.ttf'
10 changes: 8 additions & 2 deletions bs/lines_grid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ def initialize
@ys = []
@x_range = nil
@y_range = nil
@color = ?a
@width = 0.5
end

attr_accessor :color
attr_accessor :width

def xs *x
@xs.push *x
end
Expand Down Expand Up @@ -71,9 +76,10 @@ def render_dots &block
end

def render_lines which=:lines
x = self
public_send(which).each { |coords|
$bs.color ?a do
$bs.line_width 0.5 do
$bs.color x.color do
$bs.line_width x.width do
$bs.poly *coords.map { |x| $bs.g.at *x }
end
end
Expand Down
8 changes: 6 additions & 2 deletions bs/rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,15 @@ def to_rect given
end
end

def omg_text_at pos, text, align: nil, size: nil, centering: -0.1, font_is: $roboto_light
def omg_text_at pos, text, align: nil, size: nil, centering: -0.1, font_is: $roboto_light, size2: nil
size2 = size if size2.nil? # font scaling, quick-fix for shit not fitting text and ignoring it

text_at = pos #grid.at *pos.up, corner: 0
further_at = pos #grid.at *pos.up, corner: 1
size = grid.xs.step unless size

font font_is do
font_size size * 0.8 do
font_size size2 * 0.8 do
#pad_x = 0 ~width or pos
pad_y = 0
dy = size * centering # manual centering
Expand All @@ -269,6 +271,8 @@ def omg_text_at pos, text, align: nil, size: nil, centering: -0.1, font_is: $rob
when :right
text_at[0] = 0
width = further_at[0]
when :center
width = size
end

align = :left if !align
Expand Down
2 changes: 2 additions & 0 deletions gen_Days.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Days.make name: 'COLOR_Days_MIX', grid: mix_bg
$colored = false

Days.make name: 'Days_focus', grid: ?g, focus: true

Days.make name: 'Days_MIX', grid: mix_bg
Days.make name: 'Days_BLANK', grid: ?B
Days.make name: 'Days_DOT', grid: ?D
Expand Down
Binary file modified output/COLOR_Days_MIX.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ea75499

Please sign in to comment.