<commit_before>/* Clutter -  An OpenGL based 'interactive canvas' library.
 * OSX backend - initial entry point
 *
 * Copyright (C) 2007-2008  <NAME> <<EMAIL>>
 * Copyright (C) 2007  OpenedHand Ltd.
 * Copyright (C) 2011  Crystalnix <<EMAIL>>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * 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 GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 */
#include "config.h"

#include "clutter-osx.h"

#include "clutter-backend-osx.h"
#include "clutter-device-manager-osx.h"
#include "clutter-shader.h"
#include "clutter-stage-osx.h"
#include "clutter-event-loop-osx.h"

#include "clutter-debug.h"
#include "clutter-private.h"
#include "clutter-stage-private.h"

#include "cogl/cogl.h"

#import <AppKit/AppKit.h>

#define clutter_backend_osx_get_type    _clutter_backend_osx_get_type

G_DEFINE_TYPE (ClutterBackendOSX, clutter_backend_osx, CLUTTER_TYPE_BACKEND)

/*************************************************************************/
static gboolean
clutter_backend_osx_post_parse (ClutterBackend  *backend,
                                GError         **error)
{
  CLUTTER_OSX_POOL_ALLOC();
  /* getting standart dpi for main screen */
  NSDictionary* prop = [[NSScreen mainScreen] deviceDescription];
  NSSize size;
  [[prop valueForKey:@"NSDeviceResolution"] getValue:&size];
  CLUTTER_OSX_POOL_RELEASE();

  /* setting dpi for backend, it needs by font rendering library */
  if (size.height > 0)
    {
      ClutterSettings *settings = clutter_settings_get_default ();
      int font_dpi = size.height * 1024;

      g_object_set (settings, "font-dpi", font_dpi, NULL);

      return TRUE;
    }

  return FALSE;<commit_msg>osx: Use Lucida Grande as the default font<commit_after>/* Clutter -  An OpenGL based 'interactive canvas' library.
 * OSX backend - initial entry point
 *
 * Copyright (C) 2007-2008  <NAME> <<EMAIL>>
 * Copyright (C) 2007  OpenedHand Ltd.
 * Copyright (C) 2011  Crystalnix <<EMAIL>>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * 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 GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 */
#include "config.h"

#include "clutter-osx.h"

#include "clutter-backend-osx.h"
#include "clutter-device-manager-osx.h"
#include "clutter-shader.h"
#include "clutter-stage-osx.h"
#include "clutter-event-loop-osx.h"

#include "clutter-debug.h"
#include "clutter-private.h"
#include "clutter-stage-private.h"

#include "cogl/cogl.h"

#import <AppKit/AppKit.h>

#define DEFAULT_FONT_NAME       "Lucida Grande 13"

#define clutter_backend_osx_get_type    _clutter_backend_osx_get_type

G_DEFINE_TYPE (ClutterBackendOSX, clutter_backend_osx, CLUTTER_TYPE_BACKEND)

/*************************************************************************/
static gboolean
clutter_backend_osx_post_parse (ClutterBackend  *backend,
                                GError         **error)
{
  ClutterSettings *settings = clutter_settings_get_default ();

  CLUTTER_OSX_POOL_ALLOC();
  /* getting standart dpi for main screen */
  NSDictionary* prop = [[NSScreen mainScreen] deviceDescription];
  NSSize size;
  [[prop valueForKey:@"NSDeviceResolution"] getValue:&size];
  CLUTTER_OSX_POOL_RELEASE();

  /* setting dpi for backend, it needs by font rendering library */
  if (size.height > 0)
    {
      int font_dpi = size.height * 1024;

      g_object_set (settings, "font-dpi", font_dpi, NULL);
    }

  /* set the default font name */
  g_object_set (settings, "font-name", DEFAULT_FONT_NAME, NULL);

  return TRUE;
{'fraction_non_alphanumeric': 0.12886259040105194, 'fraction_numerical': 0.010081087004163927, 'mean_word_length': 4.015384615384615, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5900343', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1406, 'n_words': 449}