1cb93a386Sopenharmony_ci/* 2cb93a386Sopenharmony_ci * Copyright © 2018 Google, Inc. 3cb93a386Sopenharmony_ci * 4cb93a386Sopenharmony_ci * This is part of HarfBuzz, a text shaping library. 5cb93a386Sopenharmony_ci * 6cb93a386Sopenharmony_ci * Permission is hereby granted, without written agreement and without 7cb93a386Sopenharmony_ci * license or royalty fees, to use, copy, modify, and distribute this 8cb93a386Sopenharmony_ci * software and its documentation for any purpose, provided that the 9cb93a386Sopenharmony_ci * above copyright notice and the following two paragraphs appear in 10cb93a386Sopenharmony_ci * all copies of this software. 11cb93a386Sopenharmony_ci * 12cb93a386Sopenharmony_ci * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13cb93a386Sopenharmony_ci * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14cb93a386Sopenharmony_ci * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15cb93a386Sopenharmony_ci * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16cb93a386Sopenharmony_ci * DAMAGE. 17cb93a386Sopenharmony_ci * 18cb93a386Sopenharmony_ci * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19cb93a386Sopenharmony_ci * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20cb93a386Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21cb93a386Sopenharmony_ci * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22cb93a386Sopenharmony_ci * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23cb93a386Sopenharmony_ci * 24cb93a386Sopenharmony_ci * Google Author(s): Garret Rieger 25cb93a386Sopenharmony_ci */ 26cb93a386Sopenharmony_ci 27cb93a386Sopenharmony_ci 28cb93a386Sopenharmony_ci#include "hb-test.h" 29cb93a386Sopenharmony_ci#include "hb-subset-test.h" 30cb93a386Sopenharmony_ci 31cb93a386Sopenharmony_cistatic void 32cb93a386Sopenharmony_citest_subset_os2 (void) 33cb93a386Sopenharmony_ci{ 34cb93a386Sopenharmony_ci hb_face_t *face_abc = hb_test_open_font_file ("fonts/Roboto-Regular.abc.ttf"); 35cb93a386Sopenharmony_ci hb_face_t *face_b = hb_test_open_font_file ("fonts/Roboto-Regular.b.ttf"); 36cb93a386Sopenharmony_ci 37cb93a386Sopenharmony_ci hb_set_t *codepoints = hb_set_create(); 38cb93a386Sopenharmony_ci hb_face_t *face_abc_subset; 39cb93a386Sopenharmony_ci hb_set_add (codepoints, 98); 40cb93a386Sopenharmony_ci face_abc_subset = hb_subset_test_create_subset (face_abc, hb_subset_test_create_input (codepoints)); 41cb93a386Sopenharmony_ci hb_set_destroy (codepoints); 42cb93a386Sopenharmony_ci 43cb93a386Sopenharmony_ci hb_subset_test_check (face_b, face_abc_subset, HB_TAG ('O','S','/','2')); 44cb93a386Sopenharmony_ci 45cb93a386Sopenharmony_ci hb_face_destroy (face_abc_subset); 46cb93a386Sopenharmony_ci hb_face_destroy (face_abc); 47cb93a386Sopenharmony_ci hb_face_destroy (face_b); 48cb93a386Sopenharmony_ci} 49cb93a386Sopenharmony_ci 50cb93a386Sopenharmony_ci 51cb93a386Sopenharmony_ciint 52cb93a386Sopenharmony_cimain (int argc, char **argv) 53cb93a386Sopenharmony_ci{ 54cb93a386Sopenharmony_ci hb_test_init (&argc, &argv); 55cb93a386Sopenharmony_ci 56cb93a386Sopenharmony_ci hb_test_add (test_subset_os2); 57cb93a386Sopenharmony_ci 58cb93a386Sopenharmony_ci return hb_test_run(); 59cb93a386Sopenharmony_ci} 60