Skip to content

Commit

Permalink
remove oc_set_font/oc_set_font_size now that we use font and size exp…
Browse files Browse the repository at this point in the history
…licitly
  • Loading branch information
martinfouilleul committed Oct 31, 2024
1 parent 0b9f526 commit eef9473
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 103 deletions.
2 changes: 0 additions & 2 deletions samples/clock/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ ORCA_EXPORT void oc_on_frame_refresh(void)
const f32 uiScale = clockRadius / DEFAULT_CLOCK_RADIUS;

const f32 fontSize = 26 * uiScale;
oc_set_font(font);
oc_set_font_size(fontSize);

// clock backing
oc_set_color_rgba(1, 1, 1, 1);
Expand Down
52 changes: 0 additions & 52 deletions src/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -9916,39 +9916,6 @@
}
]
},
{
"kind": "proc",
"name": "oc_set_font",
"doc": "The the current font.",
"return": {
"kind": "void"
},
"params": [
{
"name": "font",
"type": {
"kind": "namedType",
"name": "oc_font"
}
}
]
},
{
"kind": "proc",
"name": "oc_set_font_size",
"doc": "Set the current font size.",
"return": {
"kind": "void"
},
"params": [
{
"name": "size",
"type": {
"kind": "f32"
}
}
]
},
{
"kind": "proc",
"name": "oc_set_text_flip",
Expand Down Expand Up @@ -10066,25 +10033,6 @@
},
"params": []
},
{
"kind": "proc",
"name": "oc_get_font",
"doc": "Get the current font.",
"return": {
"kind": "namedType",
"name": "oc_font"
},
"params": []
},
{
"kind": "proc",
"name": "oc_get_font_size",
"doc": "Get the current font size.",
"return": {
"kind": "f32"
},
"params": []
},
{
"kind": "proc",
"name": "oc_get_text_flip",
Expand Down
6 changes: 0 additions & 6 deletions src/graphics/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ ORCA_API void oc_set_cap(oc_cap_type cap);

ORCA_API void oc_set_fill_rule(oc_fill_rule rule);

//TODO deprecate, use shaping instead
ORCA_API void oc_set_font(oc_font font);
ORCA_API void oc_set_font_size(f32 size);
ORCA_API void oc_set_text_flip(bool flip);

ORCA_API void oc_set_image(oc_image image);
Expand All @@ -300,9 +297,6 @@ ORCA_API oc_cap_type oc_get_cap(void);

ORCA_API oc_fill_rule oc_get_fill_rule();

//TODO deprecate, use shaping instead
ORCA_API oc_font oc_get_font(void);
ORCA_API f32 oc_get_font_size(void);
ORCA_API bool oc_get_text_flip(void);

ORCA_API oc_image oc_get_image(void);
Expand Down
40 changes: 0 additions & 40 deletions src/graphics/graphics_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,24 +919,6 @@ void oc_set_fill_rule(oc_fill_rule rule)
}
}

void oc_set_font(oc_font font)
{
oc_canvas_context_data* context = oc_currentCanvasContext;
if(context)
{
context->attributes.font = font;
}
}

void oc_set_font_size(f32 fontSize)
{
oc_canvas_context_data* context = oc_currentCanvasContext;
if(context)
{
context->attributes.fontSize = fontSize;
}
}

void oc_set_text_flip(bool flip)
{
oc_canvas_context_data* context = oc_currentCanvasContext;
Expand Down Expand Up @@ -1043,28 +1025,6 @@ oc_fill_rule oc_get_fill_rule()
return (rule);
}

oc_font oc_get_font()
{
oc_font font = oc_font_nil();
oc_canvas_context_data* context = oc_currentCanvasContext;
if(context)
{
font = context->attributes.font;
}
return (font);
}

f32 oc_get_font_size()
{
f32 fontSize = 0;
oc_canvas_context_data* context = oc_currentCanvasContext;
if(context)
{
fontSize = context->attributes.fontSize;
}
return (fontSize);
}

bool oc_get_text_flip()
{
bool flip = false;
Expand Down
3 changes: 0 additions & 3 deletions src/graphics/graphics_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ typedef struct oc_attributes
oc_cap_type cap;
oc_fill_rule fillRule;

oc_font font;
f32 fontSize;

oc_image image;
oc_rect srcRegion;

Expand Down

0 comments on commit eef9473

Please sign in to comment.