1 /***************************************************************************
2 * Copyright (c) 2024 Microsoft Corporation
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the MIT License which is available at
6 * https://opensource.org/licenses/MIT.
7 *
8 * SPDX-License-Identifier: MIT
9 **************************************************************************/
10
11
12 /**************************************************************************/
13 /**************************************************************************/
14 /** */
15 /** GUIX Component */
16 /** */
17 /** Context Management (Context) */
18 /** */
19 /**************************************************************************/
20
21 #define GX_SOURCE_CODE
22
23
24 /* Include necessary system files. */
25
26 #include "gx_api.h"
27 #include "gx_system.h"
28 #include "gx_context.h"
29
30
31 /**************************************************************************/
32 /* */
33 /* FUNCTION RELEASE */
34 /* */
35 /* _gx_context_font_set PORTABLE C */
36 /* 6.1 */
37 /* AUTHOR */
38 /* */
39 /* Kenneth Maxwell, Microsoft Corporation */
40 /* */
41 /* DESCRIPTION */
42 /* */
43 /* Set the brush of the current screen context. */
44 /* */
45 /* INPUT */
46 /* */
47 /* font_id Font resource ID of current */
48 /* context */
49 /* */
50 /* OUTPUT */
51 /* */
52 /* status Completion status */
53 /* */
54 /* CALLS */
55 /* */
56 /* _gx_context_font_get Retrieve the font based on */
57 /* its resource ID. */
58 /* */
59 /* CALLED BY */
60 /* */
61 /* _gx_multi_line_text_view_draw */
62 /* _gx_single_line_text_input_draw */
63 /* _gx_widget_text_draw */
64 /* */
65 /* RELEASE HISTORY */
66 /* */
67 /* DATE NAME DESCRIPTION */
68 /* */
69 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
70 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */
71 /* resulting in version 6.1 */
72 /* */
73 /**************************************************************************/
_gx_context_font_set(GX_RESOURCE_ID font_id)74 UINT _gx_context_font_set(GX_RESOURCE_ID font_id)
75 {
76 UINT status;
77 GX_DRAW_CONTEXT *context = _gx_system_current_draw_context;
78
79 /* Set the brush. */
80 status = _gx_context_font_get(font_id, &context -> gx_draw_context_brush.gx_brush_font);
81
82 /* Return successful completion. */
83 return(status);
84 }
85
86